Return to Snippet

Revision: 12447
at March 14, 2009 19:12 by apro2000


Initial Code
function query_into_array($query){
settype($retval,"array");
$result= mysql_query($query);
$y=mysql_num_rows($result);
$k=mysql_num_fields($result);
  for($i=0;$i<$y;$i++){
    for($j=0;$j<$k;$j++){
    	$retval[$i][mysql_field_name($result,$j)] = mysql_result($result,$i, mysql_field_name($result,$j));
    }
  }
return $retval;
}

Initial URL

                                

Initial Description

                                

Initial Title
Query into Array

Initial Tags
mysql, php, array, query

Initial Language
PHP