Sorry to bother, but I am having a severe problem with this (probably stupidly) flawed 
code.

It is part of a script to call descriptions for images along with their filenames from 
a mysql database. trouble is, it doesnt work, and it claims that I have a syntax error 
near "LIMIT 10"

The code is below, and i would be very thankful if anyone could point out jsut hwat I 
am doing wrong

$newpics = mysql_query("SELECT ID, alt FROM $MID LIMIT 10");
if (!$newpics) {
echo( "<p>Error performing query " . mysql_error() . "</p>" );
exit();
}
while ( $row = mysql_fetch_array($newpics) ) {
$id=$row[ID];
$alt=$row[alt];
$alt = htmlspecialchars($alt);
$alt = eregi_replace("\[b]","<b>",$alt);
$alt = eregi_replace("\[/b]","</b>",$alt);
$alt = eregi_replace("\[i]","<i>",$alt);
$alt = eregi_replace("\[/i]","</i>",$alt);
echo("<a href=\"viewer.php?title=$title&id=$id\">$alt</a><br>");
}
?>

Reply via email to