Update query with PDO and MySQL

后端 未结 3 1779
既然无缘
既然无缘 2020-11-29 06:53

Im trying to write an update query with PDO only I cant get my code to execute?

try {
 $conn = new PDO(\"mysql:host=$hostdb; dbname=$namedb\", $userdb, $pass         


        
3条回答
  •  温柔的废话
    2020-11-29 07:19

    Your update syntax is incorrect. Please check Update Syntax for the correct syntax.

    $sql = "UPDATE `access_users` set `contact_first_name` = :firstname,  `contact_surname` = :surname, `contact_email` = :email, `telephone` = :telephone";
    

提交回复
热议问题