【发布时间】:2015-07-25 14:03:24
【问题描述】:
我尝试学习 php pdo。我正在阅读教程。
$smt = $db->prepare("SELECT * FROM table1 WHERE id = :id");
$smt->bindValue(':id', 1);
$smt->execute();
$row = $smt->fetch();
他们说 $row 给出了一个关联数组。我搜索关联数组,我希望如果我 print_r($row);我要这个:
Array (0 => 1, 1 => Column1Row1, 2 => Column2Row1);
但是我有这个:
Array ( [id] => 1 [0] => 1 [Column1] => Column1Row1 [1] => Column1Row1 [Column2] => Column2Row1 [2] => Column2Row1 )
这是什么?我应该搜索什么来学习和理解它是如何工作的?我将不胜感激任何简单的解释。谢谢。
【问题讨论】: