請幫助看看是什麼錯誤......(我測試數據庫連接是罰款)無法插入到SQLite數據庫通過PHP PDO
<?php
$user_name=$_POST['user_name'];
$password=$_POST['password'];
$dbh=new PDO('sqlite:./db/user.db') or die("fail to connect db");
try{
$stmt = $dbh->prepare("INSERT INTO user_info VALUES (?, ?)");
$stmt->bindParam(1, $a);
$stmt->bindParam(2, $b);
$a=$user_name;
$b=$password;
$stmt->execute();
}
catch(PDOException $e) {echo $e->getMessage();}
?>
什麼是拋是異常消息? – 2011-01-08 16:21:16
請幫助我們的幫助。 $ e-> getMessage()是否返回任何內容? – alexn 2011-01-08 16:21:35
什麼都沒有....這讓我瘋狂 – lkahtz 2011-01-08 16:22:05