www.webdeveloper.com
Results 1 to 4 of 4

Thread: Help me Parse error: syntax error, unexpected $end in error

  1. #1
    Join Date
    Dec 2011
    Posts
    1

    Help me Parse error: syntax error, unexpected $end in error

    Parse error: syntax error, unexpected $end in C:\xampp\htdocs\tic2211\test2.php on line 21

    <?php
    ob_start();
    include ("connection.php");
    ?>
    <html>
    <head>
    </head>
    <body>
    <ul>
    <?php
    $result= mysql_query("select * from bulletin");
    while($row=mysql_fetch_assoc($result))
    {
    ?>

    <li class="bullentin">
    <?php echo $row["bulDesc"]?></li>
    }
    </ul>
    </body>
    </html>

  2. #2
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    You were missing PHP tags around your closing while brace "}"

    Code:
    <?php
    
    	ob_start();
    	include ("connection.php");
    
    ?>
    <html>
    	<head>
    	</head>
    	<body>
    		<ul>
    <?php
    
    	$result = mysql_query("select * from bulletin");
    	while($row = mysql_fetch_assoc($result)) {
    
    ?>
    			<li class="bullentin"><?php echo $row["bulDesc"]; ?></li>
    <?php
    
    	}
    
    ?>
    		</ul>
    	</body>
    </html>

  3. #3
    Join Date
    Aug 2011
    Location
    Worthing, West Sussex
    Posts
    96
    Also, clean up your SQL:

    HTML Code:
    $result = mysql_query("SELECT * FROM `bulletin`");
    I used to write like that and when you start using different words, it really mucks up the SQL. Think of it as grammar.

  4. #4
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    Quote Originally Posted by dangerousprince View Post
    Also, clean up your SQL:

    HTML Code:
    $result = mysql_query("SELECT * FROM `bulletin`");
    I used to write like that and when you start using different words, it really mucks up the SQL. Think of it as grammar.
    If it's syntax your suggesting, I would have made the statement more specific to the data being extracted...

    Code:
    $result = mysql_query('SELECT b.bulDesc FROM bulletin b');

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles