I got a big issue with pdo, noone seems to be able to help me with - so I decided to ask you guys :-)
try {
$links = $database->prepare("SELECT * FROM aTable WHERE visible=:visible AND access<=:access AND category=:category ORDER BY orderNum ASC");
$links->bindValue(':visible',$first,PDO::PARAM_INT);
$links->bindValue(':access',$second,PDO::PARAM_INT);
$links->bindValue(':category',$third,PDO::PARAM_STR);
$links->execute();
print_r($asdf);
print_r($database->errorInfo());
print_r($links->errorInfo());
while($row = $links->fetch(PDO::FETCH_ASSOC)){
print_r($row);
}
} catch (PDOException $e) {
echo $e->getMessage();
}
Database-Connection works perfectly, the errorInfo()'s both return:
Array
(
[0] => 00000
[1] =>
[2] =>
)
Now, this code somehow doesn't get any $row's. But if I would replace the prepare statement with the following lines:
$sql = "SELECT * FROM woody_sidebar WHERE visible=$first AND access<=$second AND category=$third ORDER BY orderNum ASC";
$links = $database->prepare($sql);
(and remove the bindValue-statements) the code works like charm!
I have no clue what I'm doing wrong, because there is no error thrown at all - does anybody of you know anything I could try?
Thanks