我曾经做过 :
$resource = mysql_query("SELECT * FROM table WHERE id = " . $id);
$user = mysql_fetch_assoc($resource);
echo "Hello User, your number is" . $user['number'];
我读到 mysql 语句都已弃用,不应使用。
我怎么能用 PDO 做到这一点?
第一行是:
$stmt = $db->prepare("SELECT * FROM table WHERE id = " . $id); // there was an aditional double quote in here.
$stmt->execute(array(':id' => $id));
mysql_fetch_assoc() 函数呢?
我正在使用 php