"select username,password from user where userid=1"
$stmt->bindColumn(1,$username);
$stmt->bindColumn(2,$password);
while($stmt->fetch(PDO::FETCH_BOUND)){
echo $username,$password;
}
$stmt->bindColumn(1,$username);
$stmt->bindColumn(2,$password);
while($stmt->fetch(PDO::FETCH_BOUND)){
echo $username,$password;
}
2014-11-14
$stmt->bindParam(':username',$username,PDO::PARAM_STR);
$username = 'rambo;
$stmt->execute();
$username = 'king;
$stmt->execute();
$username = 'rambo;
$stmt->execute();
$username = 'king;
$stmt->execute();
2014-11-14
rowCount execute(array(':username'=>$username,':password'=>$password))
2014-11-14
通过这门课程 一来复习巩固pdo使用的基础知识 而来提醒自己以后要书写严谨的代码 例如在sql exec或者query的时候try-catch错误信息,并使用errorInfo获取提示信息
2014-11-12
$pdo->errorCode() $pdo->errorInfo()
2014-11-12
uri:file://dsn.txt mysql:dbname=imoov;host=loacalhost php.ini->pdo.dsn.imooc="mysql:host=localhost;dbname=imoov"
2014-11-12