Error #1064 while executing query
#1

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.
Reply
#2

add ` and ' in your SQL code.

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

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`"); 
Reply
#4

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.
Reply
#5

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");
Reply
#6

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

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 
Reply
#8

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!
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)