SQL Error

I'm trying to add a line to the coding below. The one I am having issues with is commented out, put it is causing a white page to occur. I know it's a simple syntex error that I'm over looking.
The line above, and below work fine, so I copied one of them and simply changed the information it was calling. Please help!!
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!"); 
mysql_select_db($db) or die ("Unable to select database!"); 
$query = "SELECT * 
FROM `voc2_gift` 
LIMIT 0 , 30 "; 
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); 
if (mysql_num_rows($result) > 0) { 
echo "<table bgcolor=#000000 cellpadding=50 width=100 border=1 bordercolorlight=#00FF00 bordercolorlight=#00FF00 bordercolordark=#00FF00>";
  $numItems = mysql_numrows($result);
  $itemsPerRow = 4;
  $itemsCounter = 0;
  for($i=0;$i<$numItems;$i++) {
    if($itemsCounter==0) { echo "<tr>"; }
    echo "<td><center><img src='".mysql_result($result,$i,"GiftURL")."'>";
echo "<input type=button value='Send' onclick='sendImage(".mysql_result($result,$i,"GiftURL").")'>";
    // echo "<p>".mysql_result($result,$i,"GiftPrice").;
    echo "<p>".mysql_result($result,$i,"GiftName")."</center></td>"; 
    if($itemsCounter==3) { echo "</tr>"; }
    $itemsCounter = ($itemsCounter+1)%$itemsPerRow;
  echo "</table>"; 
} else { 
  echo "No rows found!"; 

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You have a '.' at the end of your statement, that will cause a parse error

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Please, show us the fields of the table voc2_gift.
mimoserAuthor Commented:
I left the period in the line, because the line below also has a period at the begining and end, which works.

Those table fields are

Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

I would try to check your PHP logs.  That will tell you if there was a fatal error that occurred, and what it was.
Add this before the mysql_connect :


then, uncomment the line

echo "<p>".mysql_result($result,$i,"GiftPrice");

and tell us what happen.
mimoserAuthor Commented:
[15-Jul-2009 18:59:13] PHP Parse error:  syntax error, unexpected ';' in public_html/gift.php on line 118

remove the dot before ";" :)
If line 118 is line 19 in your posted code, I believe it is the '.' like I said before.  If the code changed at all, post what was ran.

mimoserAuthor Commented:
That worked. Thank you, it had me confused because of the . in front of
so I thought one was needed at the end as well.
nice one :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.