Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL Error: "an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax"
    primarykey
    data
    text
    <p>I am getting this error from MySQL:</p> <pre><code>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 'Details (title, first, last, NRIC, po' at line 1 </code></pre> <p>Here is the code:</p> <pre><code>&lt;?php $link = mysql_connect("localhost", "root", ""); if (!$link) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db(Membership, $link); if (!$db_selected) { die('Can\'t use' . Membership . ':' . mysql_error()); } $value1 = $_POST["title"]; $value2 = $_POST["first"]; $value3 = $_POST["last"]; $value4 = $_POST["NRIC"]; $value5 = $_POST["birthdate"]; $value6 = $_POST["birthmonth"]; $value7 = $_POST["birthyear"]; $value8 = $_POST["address"]; $value9 = $_POST["postal"]; $value10 = $_POST["genderSelect"]; $value11 = $_POST["contact"]; $value12 = $_POST["email"]; $value13 = $_POST["enter"]; $value14 = $_POST["password"]; $value15 = $_POST["Updates"]; $value16 = $_POST["Terms"]; $value17 = $_POST["submit_but"]; $value18 = $_POST["status"]; $sql = "INSERT INTO Member Details (title, first, last, NRIC, birthdate, birthmonth, birthyear, address, postal, genderSelect, contact, email, enter, password, Updates, Terms, submit_but, status) VALUES ('$value', '$value2', '$value3', '$value4', '$value5', '$value6', '$value7', '$value8', '$value9', '$value10', '$value11', '$value12', '$value13', '$value14', '$value15', '$value16', '$value17', '$value18')"; if (!mysql_query($sql)){ //The error is thrown here die('Error: ' . mysql_error()); } mysql_close(); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload