PHP constant encapsed string php error -
this question has answer here:
- reference - error mean in php? 29 answers
this error getting. "parse error: syntax error, unexpected t_constant_encapsed_string in on line 188" trying connect database , insert data table, can't figure out error.
$tablename = "customer"; $nullstr = "null"; $sqlstring = "insert $tablename values ('".$nullstr."','".$fname."', '".$lname."','".$address."','".$state."','".$zip."', '".$phone"','".$email"')"; $result = $mysqli->query($sqlstring);
you're missing string concatenation operator .
in couple of places.
replace
$sqlstring = "insert $tablename values ('".$nullstr."','".$fname."', ".$lname."','".$address."','".$state."','".$zip."','".$phone"','".$email"')";
with
$sqlstring = "insert $tablename values ('".$nullstr."','".$fname."', '".$lname."','".$address."','".$state."','".$zip."','".$phone."','".$email."')";
btw, variable names case-sensitive. define $nullstr
try use $nullstr
. fixed in above code.
Comments
Post a Comment