Search code examples
mysqlsyntax-errormysql-error-1064

MySQL #1064 syntax error


This is my query:

INSERT INTO exp_pdata ( steam, exp, curlevel, nextlevel, levelnum, corbarraxp ) VALUES(STEAM:O_O_O, 0, 0, 500, 1, 1);

I get this error:

#1064 - 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 ':O_O_O, 0, 0, 500, 1, 1)' at line 1 

I tried to search for this but didn't find what is causing this error,
Thanks for reading


Solution

  • Presumably, you want the value as a string:

    INSERT INTO exp_pdata ( steam, exp, curlevel, nextlevel, levelnum, corbarraxp )
        VALUES('STEAM:O_O_O', 0, 0, 500, 1, 1);
    

    You need to include single quotes to delimit the value.