Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在寻找我认为非常简单的答案!这么简单的问题,什么会
$result = mysql_result(mysql_query("SELECT name FROM cars WHERE id = 3"), 0); echo $result;
在 PDO 中?
谢谢你的帮助!
$result = $pdo->query('SELECT name FROM cars WHERE id = 3')->fetchColumn();
见PDO::query和PDOStatement::fetchColumn
PDO::query
PDOStatement::fetchColumn