I'm having a problem with my PDO statement. I have an in active pipe tail -f /var/log/apache2/error.log
watching for errors and nothing is coming in, I even piped my mysql.log
file no errors there either.
- if i
echo $_POST['sfl']
it will print an integer ie.(4) - If I change the
:sfl
param to just a regular integer ie."SELECT * FROM station WHERE SFL = '4'"
it will query and pull the data fine.
I've removed error checks from the code for clarity
$sql = "SELECT * FROM station WHERE SFL = :sfl";
$stmt = $db->prepare($sql);
$stmt->bindParam(':sfl', $_POST['sfl']);
$stmt->execute();
while($result = $stmt->fetch(PDO::FETCH_ASSOC)){
print_r($result);
}
Question: Why isn't php binding my $_POST['sfl']
variable to my statement?