PHP - Unexpected While? -


when try execute code, error saying unexpected 'while'. idea on i'm going wrong here? i'm attempting let user bid if aren't highest bidder. until tried adding in if... else statement.

<?php session_start(); require_once("dbconnect.inc");  $accountid=$_session['accountid']; $itemid=$_post['itemid'];  mysql_query("select accountid bidhistory  biditem = '$itemid' order bidhistoryid desc");  $result=mysql_query($sql)  while($row = mysql_fetch_array($result)){   $checkaccountid = $row['accountid'];   if($checkaccountid == $accountid){  echo "you highest bidder!"; }  else { $sql="insert bidhistory (accountid, biditemid) values ($accountid, $itemid)";   mysql_query(" update bidhistory set bidprice = bidprice + 1 biditemid = " . @mysql_escape_string($itemid));  $result=mysql_query($sql) or die("error in adding bid item: ".mysql_error());   } } ?> 

need add semicolon

$result=mysql_query($sql) 

so...

$result=mysql_query($sql); 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -