Hi Mark,
what is the value of $MID? Have it the table name or any other unespected
value?

Cheers
Darvin

> -----Messaggio originale-----
> Da: Mark Sweeney [mailto:[EMAIL PROTECTED]]
> Inviato: sabato 2 marzo 2002 0.17
> A: [EMAIL PROTECTED]
> Oggetto: [PHP-WIN] error query
>
>
> 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>");
> }
> ?>
>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to