我有这样的表:
table Database
+------+--------------+
| name | data |
+------+--------------+
| foo | certaindata1 |
| bar | certaindata2 |
| foo | certaindata3 |
+------+--------------+
我想为数组值输出数据,例如:
array('certaindata1','certaindata2','certaindata3')
我试过这个
$sql = mysql_query("SELECT data FROM Database");
while($row=mysql_fetch_array($sql)){
echo $row['data'];
}
结果是certaindata1certaindata2certaindata3
数组值应该在哪里'certaindata1','certaindata2','certaindata3'