This just proves once more that the syntax of putting the { tags after the while and IF is extremely bad.
Always put the opening brackets { on a new line, that way you can match up the opening and closing brackets and you would have seen rightaway that you have one closing bracket too many after your IF:
Your code:
while (list($id, $title, $url, $description) = mysql_fetch_row($result)) {
if (!$HTTP_POST_VARS['submit']){
echo "<a href=\"$url\" title=\"$description\">$title</a><br>";
}
} else {
$result = mysql_query("INSERT INTO blocks (id,title,url,description) VALUES (NULL,'$title','$url','$description')");
echo "<script>\n"
The same in proper syntax:
while (list($id, $title, $url, $description) = mysql_fetch_row($result))
{
if (!$HTTP_POST_VARS['submit'])
{
echo "<a href=\"$url\" title=\"$description\">$title</a><br>";
}
}
else
{
$result = mysql_query("INSERT INTO blocks (id,title,url,description) VALUES (NULL,'$title','$url','$description')");
echo "<script>\n"
see the difference? 🙂
Also indenting is a must (but you knew that already didn't you?)