How to turn MySQL query into an array in PHP. Print query results on screen. This is useful for determining contents of a table.
Source code viewer
// The database connection.
// SQL query.
// Fetch results and write them into an array.
$array[] = $row;
}
// Pretty print array.
// Close mysql connection.Programming Language: PHP