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 3334066
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:51:53+00:00 2026-05-17T23:51:53+00:00

I get this error… Parse error: syntax error, unexpected ‘{‘, expecting ‘(‘ in /home/content/s/k/y/skyview09/html/clients/Cheryl/admin/admin.php

  • 0

I get this error…

Parse error: syntax error, unexpected
‘{‘, expecting ‘(‘ in
/home/content/s/k/y/skyview09/html/clients/Cheryl/admin/admin.php
on line 122

when trying to run a page with multiple conditional statements (if, elseif, else).

The php that I’m tying to run is:

<?php

            if(isset($_GET['message'])){
                echo "<p><font color='#fff'>Your update was successful!</font></p>";
            }

            require("includes/connection.php");
            $article = (isset($_GET['article'])) ? $_GET['article'] : "1";
            $page = (isset($_GET['page'])) ? $_GET['page'] : "1";
            $nav = (isset($_GET['nav'])) ? $_GET['nav'] : "none";

            if($nav != "none"){

                $sql = "SELECT id, name, url, title content FROM nav WHERE id='$nav'";
                $result = $conn->query($sql) or die('Something is wrong on the test.php...Check it OUT! admin page, navigation');
                if($result){
                    $row = $result->fetch_object();
                    echo '<form method="post" action="update.php">';
                    echo '<input type="hidden" name="id" value="' . $row->id . '" />';
                    echo 'Name: <input type="text" name="name" value="' . $row->name . '" /><br>';
                    echo 'Url: <input type="text" name="url" value="' . $row->url . '" /><br>';
                    echo 'Title: <input type="text" name="title" value="' . $row->title . '" /><br>';
                    echo '<input type="submit" name="editLinks" value="Update Content" />';
                    echo '</form>';
                }

            } elseif {

            $sql = "SELECT id, content FROM articles WHERE id='$article'";
            $result = $conn->query($sql) or die('Something is wrong on the test.php...Check it OUT! admin page, articles');
                if($result){
                    $row = $result->fetch_object();
                    echo '<form method="post" action="update.php">';
                    echo '<input type="hidden" name="id" value="' . $row->id . '"';
                    echo '<textarea name="content" cols="50" rows="15">';
                    echo $row->content;
                    echo '</textarea>';
                    echo '<input type="submit" name="editContent" value="Update Content" />';
                    echo '</form>';
                }
            }

            else {

            $sql = "SELECT id, content FROM pages WHERE id='$page'";
            $result = $conn->query($sql) or die('Something is wrong on the test.php...Check it OUT! admin page, pages');
                if($result){
                    $row = $result->fetch_object();
                    echo '<form method="post" action="update.php">';
                    echo '<input type="hidden" name="id" value="' . $row->id . '"';
                    echo '<textarea name="content" cols="50" rows="15">';
                    echo $row->content;
                    echo '</textarea>';
                    echo '<input type="submit" name="editContent" value="Update Content" />';
                    echo '</form>';
                }
            }
            ?>

I would like the last “else” statement to be in the place of the “elseif” statement. And the elseif to be the last one. I tried some solutions, but nothing really worked. I don’t know what the problem is.

I thought I would find the solution already to my problem in the SO questions, but not they’re not exactly for my problem. I would appreciate the help.

  • 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-05-17T23:51:53+00:00Added an answer on May 17, 2026 at 11:51 pm

    The problem lies in your elseif statement, you need to provide a condition to the elseif.

    } elseif {
    

    Should be

    } elseif(some-condition) {
    

    All I did was read the error.

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

Sidebar

Related Questions

I get this error:- You have an error in your SQL syntax; check the
I get this error everytime I try to use my content provider to insert
I get this error: Fatal error: Call to undefined function () in /home/gmfeedsc/domains/cekdahl.com/public_html/virek/system/application/views/rekommendationer/visa.php on
i get this error HTML Parsing Error: Unable to modify the parent container element
I get this error: Can't locate Foo.pm in @INC Is there an easier way
I get this error on an update panel within a popupControlExtender which is within
I get this error when I do an svn update : Working copy XXXXXXXX
We get this error in Visual Studio 2005 and TFS very often. Can anyone
i get this error {Method 'System.DateTime ConvertTimeFromUtc(System.DateTime, System.TimeZoneInfo)' has no supported translation to SQL.}
I get this error message when installing SQL 2005 Analysis services. The cabinet File

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.