SQL Query Help
#3

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Your syntax is a little strange, you don't need those quotes around the column name and you should use the other quotes around the table name, for example:

pawn Код:
"INSERT INTO `acodes` (thecode) VALUES ('a51G81baJ11a')"
Okay that runs perfectly, however when I generate a random string and try to insert it via pawno like this:

pawn Код:
new query[195];
format(query, sizeof(query), "INSERT INTO 'acodes' (thecode) VALUES ('%s')", string);
mysql_query(string);
I get an error:

Quote:

Error (0): Failed to exeute query. 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 '9cSV395Y5AEw' at line 1

Reply


Messages In This Thread
[fixed] SQL Query Help - by Memoryz - 19.09.2011, 22:43
Re: SQL Query Help - by JaTochNietDan - 19.09.2011, 22:49
Re: SQL Query Help - by Memoryz - 19.09.2011, 22:54
Re: SQL Query Help - by [Diablo] - 19.09.2011, 23:09
Re: SQL Query Help - by Memoryz - 19.09.2011, 23:22
Re: SQL Query Help - by DRIFT_HUNTER - 19.09.2011, 23:25
Re: SQL Query Help - by Memoryz - 19.09.2011, 23:42
Re: SQL Query Help - by Jefff - 20.09.2011, 00:28
Re: SQL Query Help - by Memoryz - 20.09.2011, 00:30
Re: SQL Query Help - by Jefff - 20.09.2011, 00:36

Forum Jump:


Users browsing this thread: 1 Guest(s)