时间:2021-07-01 10:21:17 帮助过:4人阅读
注意要点
参数绑定不能应用到表名上
//错误
$sth = $dbh->prepare('SELECT name, colour, calories FROM ? WHERE calories < ?');
//正确
$sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < ?');
参数绑定不能应用到列名
//错误
$sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE ? < ?');
//正确
$sth = $dbh->prepare('SELECT name, colour, calories FROM fruit WHERE calories < ?');
以上就介绍了PHP PDO 使用注意要点,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。