$id = 1; This is OK, no problem.
This execution is wrong
$sql = "Update admin set pass= ' $pass 1 ' where id= $id;";
$mysql =new mysqlhelper ();
$count = $mysql->query ($sql);
$mysql. Close ();
You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use-near "at line 1
This execution is correct.
$sql = "Update admin set pass= ' $pass 1 ' where id=1;";
$mysql =new mysqlhelper ();
$count = $mysql->query ($sql);
$mysql. Close ();
Reply to discussion (solution)
Print out $sql and you'll know.
$id = 1; This is OK, no problem.
This execution is wrong
$sql = "Update admin set pass= ' $pass 1 ' where id= $id;";
$mysql =new mysqlhelper ();
$count = $mysql->query ($sql);
$mysql. Close ();
You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use-near "at line 1
This execution is correct.
$sql = "Update admin set pass= ' $pass 1 ' where id=1;";
$mysql =new mysqlhelper ();
$count = $mysql->query ($sql);
$mysql. Close ();
The red part has a semicolon.
$sql = "Update admin set pass= '". $pass 1. "' where id= $id; '; Change it to this test.
2L positive solution do not need to add a semicolon version of the big say is to solve this kind of problem common approach: query encountered a problem first print out a SQL statement check out nine to ten.
Tested, and that's really the problem.
Agree to the first floor, print the SQL statement will know
$sql = "Update admin set pass= '". $pass 1. "' Where id= '. $id;