new to PDO, so i dont know much, but learning.
i am just playing about with the bindings in PDO, and i dont seem to be able to get them to work
here is working code:
$prepare = $this->conn->prepare("SELECT * FROM `users` WHERE `username` = 'admin'");
$prepare->execute();
print_r($prepare->fetch());
now i wish to use bindings, and replace the admin part: i have this, and its not working (banging my head on the wall didn't help)
$prepare = $this->conn->prepare("SELECT * FROM `users` WHERE `username` = ':user'");
$prepare->execute(array(':user' => "admin"));
print_r($prepare->fetch());
where am i going wrong?