SA-MP Forums Archive
MySQL Error in the Query? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL Error in the Query? (/showthread.php?tid=158160)



MySQL Error in the Query? - Antonio [G-RP] - 08.07.2010

I am having a problem here, most likely to do with the floats. Does anybody know the problem?

Код:
format(Query, sizeof(Query), "INSERT INTO `accounts` (username, password, level, cash, pos_x, pos_y, pos_z) VALUES('%s', '%s', '%d', '%f', '%f', '%f')", EscapedName, EscapedPassword, 1, 2500, 1742.9363, -1861.8215, 13.5770);



Re: MySQL Error in the Query? - Antonio [G-RP] - 09.07.2010

Anybody?


Re: MySQL Error in the Query? - Carlton - 09.07.2010

pawn Код:
format(Query, sizeof(Query), "INSERT INTO `accounts` (username, password, level, cash, pos_x, pos_y, pos_z) VALUES('%s', '%s', 1, 2500, '1742.9363', '-1861.8215', '13.5770')", EscapedName, EscapedPassword);



Re: MySQL Error in the Query? - Antonio [G-RP] - 09.07.2010

Hmm still didn't work.. Check this...


Код:
[02:55:15] MySQL Error (0): Could not execute 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 ''17' at line 1.
[02:55:15] MySQL Error (0): Could not execute query. Unknown column 'biskey' in 'field list'.
[02:55:15] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.
[02:55:16] MySQL Error (0): Could not execute query. Unknown column 'biskey' in 'field list'.
[02:55:16] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.
[02:55:18] MySQL Error (0): Could not execute query. Unknown column 'biskey' in 'field list'.
[02:55:18] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.



Re: MySQL Error in the Query? - Carlton - 09.07.2010

Quote:
Originally Posted by Antonio [G-RP]
Посмотреть сообщение
Hmm still didn't work.. Check this...


Код:
[02:55:15] MySQL Error (0): Could not execute 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 ''17' at line 1.
[02:55:15] MySQL Error (0): Could not execute query. Unknown column 'biskey' in 'field list'.
[02:55:15] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.
[02:55:16] MySQL Error (0): Could not execute query. Unknown column 'biskey' in 'field list'.
[02:55:16] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.
[02:55:18] MySQL Error (0): Could not execute query. Unknown column 'biskey' in 'field list'.
[02:55:18] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.
That's your problem, you need to add a biskey named field. I didn't even fix anything related to biskey you're directing me to the wrong query


Re: MySQL Error in the Query? - Antonio [G-RP] - 09.07.2010

Ah my apologies, I spelt it wrong from what it really is. Here is the MAIN errors.

Код:
[02:58:42] MySQL Error (0): Could not execute 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 ''17' at line 1.
[02:58:42] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.
[02:58:43] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.
[02:58:47] MySQL Error (0): Could not execute 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 '0' WHERE `SQLid` = '0'' at line 1.



Re: MySQL Error in the Query? - Carlton - 09.07.2010

There's no SQLid in the query you posted. I can't fix a query that hasn't been posted.


Re: MySQL Error in the Query? - Antonio [G-RP] - 09.07.2010

Must be this.. but because of these errors, I cannot register / create a character.

Код:
format(Query, sizeof(Query), "SELECT `SQLid` FROM `accounts` WHERE `username` = '%s'", EscapedName);



Re: MySQL Error in the Query? - Antonio [G-RP] - 11.07.2010

Any idea's?


Re: MySQL Error in the Query? - Carlton - 11.07.2010

You're still posting the wrong query.