Jump to content

[SOLVED] Can someone spot an error?


DBookatay

Recommended Posts

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

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']."'";
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.