PHP ---->PDO鏈接mysql
PDO對(duì)象能獲取到,但是怎么執(zhí)行都不能成功,反反復(fù)復(fù)檢查了N遍,都是錯(cuò)的。。求救
<?php
try{
?$pdo=new PDO('mysql:host:localhost;dbname=books','root',''); ??
?$sql="insert test(username,sex,birth) values('admin','15',NOW());";
var_dump($pdo->exec($sql));
?var_dump($pdo);
}catch(PDOException $e){
echo $e->getMessage();
}
2017-02-11
host后 : 改 =?