且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP的PDO语句错误

更新时间:2023-02-22 17:37:36

而不是数据库中使用dbname

in your db connection string instead of database use dbname

  $conn = new PDO('mysql:host=localhost;database=evouchers', $user, $password);
  ---------------------------------------^



 $conn = new PDO('mysql:host=localhost;dbname=evouchers', $user, $password);

文档链接: http://php.net/manual/en/pdo.connections .php