$thearray = array
(
//(0)ID, (1)NAME, (2)LOCATION, (3)PHONE
array("0","Name 1","Nowhere 11","0004444"),
array("1","Name 2","Everywhere 11","0005555"),
array("2","Name 3","ThisPlace 11","0002222"),
array("3","Name 4","NoPlace 11","0003333"),
array("4","Name 5","ThatPlace 11","0001111")
);
这就是我用来存储我的信息的方式,然后我会遍历它们以找到我需要的内容并使用例如显示它们
echo $thearray[$i][4]
除了将信息存储在 Mysql 中之外,我想做同样的事情这是我已经走了多远,但我不断收到奇怪的错误,我无法从数组中输出
这就是我已经走了多远
$result = $db->query("SELECT * FROM table");
$thearray = array();
while($thearray = $result->fetch_assoc()){
$thearray[] = $thearray;
}
出于某种原因,这对我不起作用,它就像我上面所说的那样不在二维数组中:SI 不能像以前那样简单地回显它。