-
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>
-
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>
-
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.
-
 Originally Posted by dangerousprince
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
Forum Rules
|
|
Bookmarks