mardi 5 mai 2015

SQL Query Error - check the manual that corresponds to your MySQL server version

SQL - It's been a while.

I need to figure out why the following SQL is failing:

$query = "INSERT INTO users ('c_id', 'c_email', 'c_fname', 'csname', 'c_mobile', 'c_add_1', 'c_add_2', 'c_city', 'c_county', 'c_postcode', 'c_comments') VALUES ('null','josh','hh', 'hh', 'hhhh', 'hh', 'hhh', 'hhh', 'hhhh', 'hh', 'hhh')";

I have tried it without the c_id being null.

I am getting the following message:

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 ''c_id', 'c_email', 'c_fname', 'csname', 'c_mobile', 'c_add_1', 'c_add_2', 'c_cit' at line 1 

Here is my code where the query is executed:

if (mysqli_query($conn,$query))
{
   echo "k";
}       
else
{
    echo mysqli_error($conn);
}

Aucun commentaire:

Enregistrer un commentaire