New code error!

There is an error with the while on the 4th line of code below. It’s a syntax error saying that “unexpected T_LOGICAL_OR in /home/a3362820/public_html/assignment/index.php”


echo “<h1>Blog</h1><hr>”;


$queryget = mysql_query(“SELECT * FROM blogEntries ORDER BY id DESC”);

while ($row = mysql_fetch_assoc($queryget)) or die (mysql_error())
$id = $row[‘id’];
$name = $row[‘name’];
$message = $row[‘message’];
$date = $row[‘date’];
$time = $row[‘time’];

echo “<hr>”;

echo "
<form action=;index.php’ method=‘POST’>
<table width=‘100%’>
<td width=‘18%’ valign=‘top’>
Your name:
<input type=‘text’ name=‘name’ maxlength=‘25’>

       &lt;td valign='top'&gt;
       Your message:
       &lt;textarea cols='20' rows='2' name='message maxlength='250'&gt;
       &lt;input type='submit' name='submit' value='Post'&gt;



Any help would be appreciated.

Please use the appropriate tags when you post code.

And why do you use ‘or die’ here?

while ($row = mysql_fetch_assoc($queryget)) or die (mysql_error())

Use it on the mysql_query command instead.

This line is not correct syntax:

while ($row = mysql_fetch_assoc($queryget)) or die (mysql_error())

You need to remove the or die (mysql_error())" bit.

Don’t add any code between the closing ‘)’ of the while condition and the ‘{’.
Rewriting the while sentence …

while ($row = mysql_fetch_assoc($queryget) or die(mysql_error()))

To be honest you should not be using “or die()” in the first place.
Implement proper error handling from the beginning.