How do I store all results from an SQL query in a multidimensional array?

后端 未结 5 1302
心在旅途
心在旅途 2021-02-08 17:46

hello every one i want to convert my array into other array type , plz help me out . I m using this

$row = mysql_fetch_array($result, MYSQL_ASSOC); 
5条回答
  •  名媛妹妹
    2021-02-08 18:18

    If you need to store all rows returned by the query in an array, try this:

    $result = array(); 
    
    while ( $row = mysql_fetch_array($result, MYSQL_ASSOC) ){
        $result[] = $row
    }
    

提交回复
热议问题