PHP constant encapsed string php error -


this question has answer here:

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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -