A: 

Try this (Without the ticks)

$sql = "SELECT * FROM images WHERE iimageid = '" . $iimageid . "'";

or (typecasting to integer)

$sql = "SELECT * FROM images WHERE iimageid = ". (int)$iimageid;

If its an integer value always typecast to integer, then any text string it will automatically set to 0 "For security purposes"

Roland
Alternatively, you can opt not to even execute the statement if the $iimageid is not numeric, using is_numeric.
iddqd
A: 

It looks like your SQL statement is invalid to me, try:

"SELECT * FROM images WHERE iimageid = '" . $iimageid . "'";
James
+1  A: 

Ok nm, I found it pretty quickly after submitting this thing. $iimageid wasn't being pulled, taken care of now. :)

JParsons4
Does your code above execute correctly? As it doesn't look like it is in the correct SQL syntax i.e. apostrophes around column/table name)
James
Those are backticks, not apostrophes. They're used to indicate that a string represents a column. You typically only NEED them if you use a reserved name for a column or table name.
iddqd
A: 

Looks like a PHP error to me, not MySQL. Those error codes are normally by the PHP interpreter finding something it doesn't like in your code. You also appear to have not closed off the <a> tag? And there appears to be an extra " after your 'thumb/' part of the <img> tag.

I would re-write this section;

        <?  while($display_info = mysql_fetch_array($runSQL)) { ?>
                    <a href="sfd/pimages/<? echo $display_info['vimage']; ?>" rel="lightbox[g]"><img src="sfd/pimages/thumb/"<? echo $display_info['vimage']; ?>">
                <br>
        <?  } ?>

As follows, see if that helps.

        <?  
        while ( $display_info = mysql_fetch_array($runSQL) ) { 
             print "<a href=\"sfd/pimages/{$display_info['vimage']}\" rel=\"lightbox[g]\">";
             print "<img src=\"sfd/pimages/thumb/{$display_info['vimage']}\">";
             print "</a><br>\n";
        } 
        ?>
Dave Rix
A: 

Everytime someone uses mysql_* functions, baby raptor jesus eats a lolcat. You should start using PDO ( http://fr.php.net/manual/en/book.pdo.php ), and for the part mixing html and php you may prefer the alternative syntax http://www.php.net/manual/en/control-structures.alternative-syntax.php

Arkh
Top use of "baby raptor"!
richsage