Delete Please tell me how to delete a record using native PHP PDO. It has been unsuccessful and I don't know where the mistake is.-PHP Chinese Network Q&A
Please tell me how to delete a record using native PHP PDO. It has been unsuccessful and I don't know where the mistake is.
志远电脑小马哥
志远电脑小马哥 2022-05-11 20:38:55
0
2
804
志远电脑小马哥
志远电脑小马哥

reply all (1)
志远电脑小马哥
$sql="DELETE From ".$t." where id=".$tid;

The id here is an input error. Normally it should be tid. The problem is not here. After the interruption, the sql is normal. DELETE From link where id=69 The database has this record.

$count=$conn->exec($sql); //这个是出错行。

  • reply Didn't you pass $conn into the delInfo method? Didn't you see an error saying that the exec member method could not be found?
    ABOUT author 2022-05-27 09:52:06
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!