Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
不知道我错过了什么,我在其他论坛或谷歌上找不到任何答案。._. 我想在查询中添加什么?
$STH->bindParam(1, $name); $STH->bindParam(2, $comment); $STH = $db-("INSERT INTO comment ('name', 'comment') VALUES (:name, :comment)"); $STH->execute();
顺序应该是这样的:
$STH = $db->prepare("INSERT INTO comment ('name', 'comment') VALUES (:name, :comment)"); $STH->bindParam(':name', $name,PDO::PARAM_STR); $STH->bindParam(':comment', $comment,PDO::PARAM_STR); $STH->execute();