时间:2021-07-01 10:21:17 帮助过:10人阅读
$conn = mysql_connect("localhost","root","");mysql_select_db("mydatabases",$conn);$result = mysql_query("select name from user where id = 1");while ($row = mysql_fetch_array($result)){ echo $row['name'];}
$db = new PDO($dsn, $user, $pass);$rs = $db->query($sql);$a = $rs->fetch(PDO::FETCH_ASSOC);
$db = new PDO($dsn, $user, $pass);$rs = $db->query($sql);$a = $rs->fetch(PDO::FETCH_ASSOC);