There is an error in inserting post data into PHP code. Please give me some advice.
人间惆怅客
人间惆怅客 2019-04-17 09:34:33
0
1
945

$mql="insert into user(uname,uage,passwd) value('"$uname"','"$uage"','"$passw"')" ;

Browser The feedback error is syntax error, unexpected T_VARIABLE. What is the error? What is the correct way to write it?

人间惆怅客
人间惆怅客

reply all(1)
Peter-Zhu

Correct grammar:

$mql = "INSERT INTO `user` (`uname`, `uage`, `passwd`) VALUES ('{$uname}', {$uage}, '{$passwd}')";

or:

$mql = "INSERT INTO `user` SET `uname` = '{$uname}',  `uage` = {$uage}, `passwd` = '{$passwd}'";
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template