atticus Posted June 22, 2012 Share Posted June 22, 2012 I know that I am missing something simple, probably in my syntax. But I am getting a 500 server error instead of a PHP error. Not sure why Here is the total associative array query: $query = "SELECT address, zip, square_footage FROM person WHERE person_id = $id"; if ($result = $mysqli->query($query)) { /* fetch associative array */ while ($row = $result->fetch_assoc()) { $message .= '\n <strong>Square Footage: </strong>' .$row["square_footage"]; $message .= '\n <strong>Address </strong>' .$row["address"]; $message .= '\n <strong>Zip </strong>' .$row["zip"]); } /* free result set */ $result->free(); } If I remove the following three lines, I no longer get an error: $message .= '\n <strong>Square Footage: </strong>' .$row["square_footage"]; $message .= '\n <strong>Address </strong>' .$row["address"]; $message .= '\n <strong>Zip </strong>' .$row["zip"]); Quote Link to comment https://forums.phpfreaks.com/topic/264612-500-server-error-mysqli-associative-array/ Share on other sites More sharing options...
PaulRyan Posted June 22, 2012 Share Posted June 22, 2012 Look at this line: $message .= '\n <strong>Zip </strong>' .$row["zip"]); Noticed the bracket at the end? Try removing it? Quote Link to comment https://forums.phpfreaks.com/topic/264612-500-server-error-mysqli-associative-array/#findComment-1356122 Share on other sites More sharing options...
atticus Posted June 22, 2012 Author Share Posted June 22, 2012 Noticed the bracket at the end? Try removing it? Worked, Thanks Ryan! Quote Link to comment https://forums.phpfreaks.com/topic/264612-500-server-error-mysqli-associative-array/#findComment-1356126 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.