Jump to content

500 Server Error - mysqli associative array


atticus

Recommended Posts

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"]);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.