PDO数据库

$dsn = "mysql:host=localhost;dbtable=...";

$user = "";

$passwd = "";

$pdo = new PDO($dsn,$user,$passwd);

$sql = "";

1. $pdoS = $pdo->query($sql);

return pdoStatement Object

 

2. $pdoS = $pdo->prepare($sql);

return pdoStatement Object

  $pdoS->bindParam();

  $pdoS->execute($sql);

  $pdoS->fetch();

  $pdoS->fetchAll();

posted @ 2014-01-07 20:52  cq351266168  阅读(132)  评论(0编辑  收藏  举报