DBookatay Posted October 5, 2007 Share Posted October 5, 2007 Can someone spot an error: if(strlen($_POST['vin']) == 6) {$where[] = "vin LIME '%$_POST['vin']'";} else {$where[] = "vin = '$_POST['vin']'";} I get the following Parse Error: "Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/.phillipina/dbookatay/login.carcityofdanbury.com/passed/New/list.php on line 242" and I cant figure out why... Link to comment https://forums.phpfreaks.com/topic/71898-solved-can-someone-spot-an-error/ Share on other sites More sharing options...
teng84 Posted October 5, 2007 Share Posted October 5, 2007 if(strlen($_POST['vin']) == 6) { $where[] = "vin LIME '%{$_POST['vin']}'"; } else { $where[] = "vin = '{$_POST['vin']}'"; } // or ------------ if(strlen($_POST['vin']) == 6) { $where[] = "vin LIME '%".$_POST['vin']."'"; } else { $where[] = "vin = '".$_POST['vin']."'"; } Link to comment https://forums.phpfreaks.com/topic/71898-solved-can-someone-spot-an-error/#findComment-362185 Share on other sites More sharing options...
DBookatay Posted October 5, 2007 Author Share Posted October 5, 2007 $where[] = "vin LIME '%".$_POST['vin']."'"; Do you mean "LIKE" or is "LIME" correct? Link to comment https://forums.phpfreaks.com/topic/71898-solved-can-someone-spot-an-error/#findComment-362188 Share on other sites More sharing options...
teng84 Posted October 5, 2007 Share Posted October 5, 2007 yes? heres an issue with '$var['foo']' once you enclose your array with '' or "" php is confuse how to read it and can you tell me why u use this phillipina as your dir name is that your country? Link to comment https://forums.phpfreaks.com/topic/71898-solved-can-someone-spot-an-error/#findComment-362192 Share on other sites More sharing options...
DBookatay Posted October 5, 2007 Author Share Posted October 5, 2007 and can you tell me why u use this phillipina as your dir name is that your country? Thats what my hosting company (DreamHost.com) uses... Link to comment https://forums.phpfreaks.com/topic/71898-solved-can-someone-spot-an-error/#findComment-362201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.