My php crashes without an error because of the following code:
//print some html
$server = "localhost"; $user = "iremovedthis"; $pass = "iremovedthis";
$connection = new mysqli($server, $user, $pass);
if ($connection->connect_errno) {
printf("Connect failed: %s\n", $connection->connect_error);
exit(); }
$game_query = "SELECT * FROM games LIMIT 9;";
$game_query_result = $connection->query($game_query);
$row = $game_query_result->fetch_array(MYSQLI_ASSOC);
//print more html
I'm trying to put the SQL result into an array.
If i comment the last line (starting with $row), my PHP keeps nicely printing HTML, but if i include the last line, it only outputs the HTML before my code and it doesn't give me a print error.
I seem have followed the PHP manual to a tee, anyone know what could be causing this?
crashes? Have you checked your error logs? Is error reporting on? What is the result of$game_query_result?$connection->connect_errorsays after query call?