Some code here, I want store mysql query result into an array with php, but my code return result: 2h, not what I wish.(the correct result should be 36,35,34,33
2h
I think you wanted to do this:
while( $row = mysql_fetch_assoc( $result)){ $new_array[] = $row; // Inside while loop }
Or maybe store id as key too
$new_array[ $row['id']] = $row;
Using the second ways you would be able to address rows directly by their id, such as: $new_array[ 5].
$new_array[ 5]