Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8422893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:34:56+00:00 2026-06-10T03:34:56+00:00

I’m new to this coding game, but I cannot find my syntax/parse error in

  • 0

I’m new to this coding game, but I cannot find my syntax/parse error in this code. The error is saying Line 86 which is the end of the code. I have tried to add brackets, but have not had luck. This is likely a basic question, but I have been struggling with it for awhile so thought I’d shoot it up here to see if I could get some clear guidance and stop just throwing stuff in.

    <html>
    <head>
<title>View Guestbook</title>
<link rel="stylesheet" type="text/css" href="css/king.css" />
  </head>

   <body>
  <img src="images/KingLogo.jpg"><br>

    <?php
include "king_common_functions.php";

viewGuestbook();

     //****************************************************************
     //Display Admin Guestbook Data (All Submissions)
    //****************************************************************

function viewGuestbook()
{
    $outputDisplay = "";
    $myrowcount = 0;

    $statement  = "SELECT lastname, firstname, contact_type, contact_info,";
    $statement  = "city, comments, date_added";
    $statement .= "FROM u1585_Guestbook ";
    $statement .= "ORDER BY lastname ";

    $sqlResults = selectResults($statement);

    $error_or_rows = $sqlResults[0];

    if (substr($error_or_rows, 0 , 5) == 'ERROR')
    {
        print "<br />Error on DB";
        print $error_or_rows;
    } else {
        $arraySize = $error_or_rows;

            for ($i=1; $i <= $error_or_rows; $i++)
            {
                $lastname = $sqlResults[$i]['lastname'];
                $firstname = $sqlResults[$i]['firstname'];
                $contact_type = $sqlResults[$i]['contact_type'];
                $contact_info = $sqlResults[$i]['contact_info'];
                $city = $sqlResults[$i]['city'];
                $comments = $sqlResults[$i]['comments'];
                $date_added = $sqlResults[$i]['date_added'];

                $outputDisplay  = "<h3>View Guestbook:</h3>";
                $outputDisplay .= '<table border=1 style="color: black;">';
                $outputDisplay .= '<tr><th>Last Name</th><th>First Name</th><th>Contact Type</th><th>Contact Info</th>';
                $outputDisplay .= '<th>City</th><th>Comments</th><th>Date Added</th></tr>';

                $numresults = mysql_num_rows($sqlResults);

                for ($j = 0; $j < $numresults; $j++)
                {
                    if (!($j % 2) == 0)
                    {
                        $outputDisplay .= "<tr style=\"background-color: #F5DEB3;\">";
                    } else {
                        $outputDisplay .= "<tr style=\"background-color: white;\">";
                    }

                $myrowcount++;

                $outputDisplay .= "<td>".$lastname."</td>";
                $outputDisplay .= "<td>".$firstname."</td>";
                $outputDisplay .= "<td>".$contact_type."</td>";
                $outputDisplay .= "<td>".$contact_info."</td>";
                $outputDisplay .= "<td>".$city."</td>";
                $outputDisplay .= "<td>".$comments."</td>";
                $outputDisplay .= "<td>".$date_added."</td>";
                $outputDisplay .= "</tr>";
            }
    }
    $outputDisplay .= "</table>";
    $outputDisplay .= "<br /><br /><b>Number of Rows in Results: $myrowcount </b>    <br /><br />";
    print $outputDisplay;
    }
    ?>
    </p>

     </body>
    </html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:34:58+00:00Added an answer on June 10, 2026 at 3:34 am

    Your for loop here isn’t being closed properly, I think:

    for ($j = 0; $j < $numresults; $j++)
        {
        if (!($j % 2) == 0)
           {
           $outputDisplay .= "<tr style=\"background-color: #F5DEB3;\">";
        } else {
           $outputDisplay .= "<tr style=\"background-color: white;\">";
        }
    
    $myrowcount++;
    

    Indenting your code makes it much easier to spot where you’re missing braces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.