0

When running this PHP code:

...
if ($query = $con->prepare("update member set group = 1 where email = ? and verifycode = ? and group = 0")) { // sql error :(
    $query->bind_param("ss", $_GET["email"], $_GET["code"]);
    $query->execute();
    $query->close();
    echo "ok";
} else
    echo "query failed: " . $con->error;
...

It prints the following:

query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group = 1 where email = ? and verifycode = ? and group = 0' at line 1

This is the structure of the "member" table:

enter image description here

What's wrong with the SQL command?

david
  • 292
  • 5
  • 20

0 Answers0