PDO Database access WHERE title = $title

后端 未结 5 1445
無奈伤痛
無奈伤痛 2021-01-26 15:03

I\'m trying to learn to use PDO instead of MySQLi for database access and I\'m having trouble selecting data from the database. I want to use:

$STH = $DBH->qu         


        
5条回答
  •  失恋的感觉
    2021-01-26 15:57

    1. Make PDO throw errors so you can see what exactly goes wrong. See How to squeeze error message out of PDO?

    2. You are probably missing quotes around $title but this scenario really calls for prepared statements instead.

提交回复
热议问题