php 将数据库查询出的数据放到一个二维数组


$conn=new mysqli('localhost','root','123456','test');

$conn->select_db('test');

$result=$conn->query("select posted_on,user_name,message,color from chat");

$array=array();

while($row=mysqli_fetch_array($result,MYSQL_BOTH)){
	
	$array[]=$row;
	
}

print_r($array);

你可能感兴趣的:(php 将数据库查询出的数据放到一个二维数组)