jenniferG Posted August 28, 2007 Share Posted August 28, 2007 The below script gives us a query error in Red below-CAMERAMODEL is certainly in TABLE SIPRODUCTTABLE --------------------------------------------------------------------------------------- <?php include 'mysql_connect.php'; $_REQUEST['CAMERAMODEL']='SI-1M90-FT'; if (isset($_REQUEST['CAMERAMODEL'])){ $CAMERAMODEL=$_REQUEST['CAMERAMODEL']; $MSRPQUERY="SELECT MSRP FROM SIPRODUCTTABLE WHERE CAMERAMODEL=$CAMERAMODEL"; $FIND=mysql_query($MSRPQUERY) or die('Cannot get MSRP' . mysql_error()); if ($ROW=mysql_fetch_array($FIND)){$MSRP=trim($ROW['MSRP']);} print $MSRP; exit; }else {print 'Camera Field Not Sent';exit;} ?> //Cannot get MSRPUnknown column 'SI' in 'where clause' Thanks, NatalieG Quote Link to comment Share on other sites More sharing options...
Jessica Posted August 28, 2007 Share Posted August 28, 2007 Strings have to be surrounded in quotes. Change it to: WHERE CAMERAMODEL='$CAMERAMODEL'"; Quote Link to comment Share on other sites More sharing options...
piznac Posted August 28, 2007 Share Posted August 28, 2007 try this: $MSRPQUERY="SELECT `MSRP` FROM SIPRODUCTTABLE WHERE `CAMERAMODEL` = '$CAMERAMODEL'"; Might work Whoops to late Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.