SA-MP Forums Archive
Error #1064 while executing 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)
+--- Thread: Error #1064 while executing query (/showthread.php?tid=652249)



Error #1064 while executing query - Eripe - 06.04.2018

Hello, I came across such a mistake while making a bank in MySQL
PHP код:
[14:57:27] [plugins/mysqlerror #1064 while executing query "INSERT INTO kontagraczy(name,password,skinid,bank,plec,wiek,vip,frakcja,money) VALUES ('chujekmujek','074A79ACBBF54463DEDB0E182E28054251E2B363A70D41ABE8143FDA62E7521D934C3074A87F81146F2F9F81A3C63017E349F409578305EE5D5A4A6839DCE579','6','0','1','23','0','0',": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 
CODE
https://pastebin.com/t2QM3qVv


I am asking for help, thank you in advance and I am sorry for the mistakes translate ******.
I'm from Poland.


Re: Error #1064 while executing query - Mugala - 06.04.2018

add ` and ' in your SQL code.

PHP код:
strcat(query"INSERT INTO `kontagraczy` (");
    
//
    
strcat(query"`name`,");
    
strcat(query"`password`,"); 



Re: Error #1064 while executing query - Eripe - 06.04.2018

Thanks for the answer, unfortunately it did not help ...

PHP код:
    strcat(query"INSERT INTO  `kontagraczy` (");
    
//
    
strcat(query"`name`,");
    
strcat(query"`password`,");
    
strcat(query"`skinid`,");
    
strcat(query"`bank`,");
    
strcat(query"`plec`,");
    
strcat(query"`wiek`,");
    
strcat(query"`vip`,");
    
strcat(query"`frakcja`,");
    
strcat(query"`money`"); 



Re: Error #1064 while executing query - Mugala - 06.04.2018

add there too strcat(query, "INSERT INTO `kontagraczy`(");
if its wont work, than type this whole code in your phpMyAdmin's SQL, there will be better look to find out your problem.
also increase the string[258]; value from 258 to 1920, looks like you're using bigger strings.


Re: Error #1064 while executing query - ForCop - 06.04.2018

Quote:
Originally Posted by Eripe
Посмотреть сообщение
Thanks for the answer, unfortunately it did not help ...

PHP код:
    strcat(query"INSERT INTO  `kontagraczy` (");
    
//
    
strcat(query"`name`,");
    
strcat(query"`password`,");
    
strcat(query"`skinid`,");
    
strcat(query"`bank`,");
    
strcat(query"`plec`,");
    
strcat(query"`wiek`,");
    
strcat(query"`vip`,");
    
strcat(query"`frakcja`,");
    
strcat(query"`money`"); 
Код:
	strcat(query, "INSERT INTO  `kontagraczy` (");
	//
	strcat(query, "`name`varbinary(30) NOT NULL,");
	strcat(query, "`password`varbinary(30) NOT NULL,");
	strcat(query, "`skinid`int(3) NOT NULL,");
	strcat(query, "`bank`int(12) NOT NULL,");
	strcat(query, "`plec`int(12) NOT NULL,");
	strcat(query, "`wiek`int(12) NOT NULL,");
	strcat(query, "`vip`int(12) NOT NULL,");
	strcat(query, "`frakcja`int(12) NOT NULL,");
	strcat(query, "`money`int(12) NOT NULL");
        strcat(query, ") ENGINE = InnoDB CHARACTER SET=utf8");



Re: Error #1064 while executing query - Eripe - 06.04.2018

This is my job, I remove everything related to the bank, saving, loading and creating an account, and everything is fine


Re: Error #1064 while executing query - Eripe - 06.04.2018

Unfortunately, nothing more, thank you for the answers

PHP код:
[15:36:41] [plugins/mysqlerror #1064 while executing query "INSERT INTO  `kontagraczy` (`name`varbinary(30) NOT NULL,`password`varbinary(30) NOT NULL,`skinid`int(3) NOT NULL,`bank`int(12) NOT NULL,`plec`int(12) NOT NULL,`wiek`int(12) NOT NULL,`vip`int(12) NOT NULL,`frakcja`int(12) NOT NULL,`money`int(12) NOT NULL) E": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'varbinary(30) NOT NULL,`password`varbinary(30) NOT NULL,`skinid`int(3) NOT NULL,' at line 1 



Re: Error #1064 while executing query - Gammix - 06.04.2018

Its simple, your "new string[258]" is smaller size than your actual query length, which causes Syntax error. Increase it to like 512, depending on your query size basically!


Re: Error #1064 while executing query - Eripe - 06.04.2018

I erased everything, which is connected with the bank, and I wrote again and noticed that only the first account is registered, then the next one does not take place anymore


Re: Error #1064 while executing query - Mugala - 06.04.2018

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Its simple, your "new string[258]" is smaller size than your actual query length, which causes Syntax error. Increase it to like 512, depending on your query size basically!
I already told him, but dunno if he changed.