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.
このクエリの場合: $sql='select col from table where other_col=?';
$sql='select col from table where other_col=?';
私は現在、次のように返されたデータを取得しています。 $data=$statement->fetch()['col'];
$data=$statement->fetch()['col'];
それは私にはあまりよく見えません。それを行うためのより良い方法はありますか、それともそれはそれでいいですか?
あなたが試すことができます :
$data=$statement->fetchColumn(0);