note 76138 added to function.PDOStatement-bindParam
| From: | m dot van dot urk at comsi dot nl | Date: | Mon, 02 Jul 2007 14:33:51 +0000 |
| Subject: | note 76138 added to function.PDOStatement-bindParam | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-128156@lists.php.net to get a copy of this message | ||
You can't bind a table name in the query.
So the following code isn't working:
$a = 'klanten';
$sQuery = "SELECT COUNT(*) FROM ? WHERE email = 'info@site.uk' AND wachtwoord =
'welcome'";
$rResult2 = $login->db->prepare($sQuery);
$rResult2->bindValue(1, $a);
$rResult2->execute();
}
catch (PDOException $e) {
die( $e-getMessage());
}
if ($rResult2->fetchColumn() == 0) {
echo 'false';
} else {
echo 'true';
}
----
Server IP: 83.137.20.120
Probable Submitter: 212.129.182.82
----
Manual Page -- http://www.php.net/manual/en/function.PDOStatement-bindParam.php
Edit -- https://master.php.net/note/edit/76138
Del: integrated -- https://master.php.net/note/delete/76138/integrated
Del: useless -- https://master.php.net/note/delete/76138/useless
Del: bad code -- https://master.php.net/note/delete/76138/bad+code
Del: spam -- https://master.php.net/note/delete/76138/spam
Del: non-english -- https://master.php.net/note/delete/76138/non-english
Del: in docs -- https://master.php.net/note/delete/76138/in+docs
Del: other reasons-- https://master.php.net/note/delete/76138
Reject -- https://master.php.net/note/reject/76138
Search -- https://master.php.net/manage/user-notes.php