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 Link to comment https://forums.phpfreaks.com/topic/67129-query-problem/ 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'"; Link to comment https://forums.phpfreaks.com/topic/67129-query-problem/#findComment-336660 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 Link to comment https://forums.phpfreaks.com/topic/67129-query-problem/#findComment-336662 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.