Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Fratello on Jan 18, 2018, 02:25 PM

Title: MySQL query didn't execute.
Post by: Fratello on Jan 18, 2018, 02:25 PM
Greetings.

My SQL isn't being executed at all.

Quotemysql_query(mysqlDB, "INSERT INTO `test` (id, username) VALUES("0", 'testt');");

My connection (under onscriptload)
QuotemysqlDB <- mysql_connect("**", "**", "**", "**");
   if( mysqlDB ) print( "[SERVER] Connection to mySQL database successful." );
   else print( "[SERVER] Connection to mySQL failed." );

I always get 'connection to mysql databse successful' message. And yes, I have table 'test' and database vcmp with all items inside it.

Thanks!
Title: Re: MySQL query didn't execute.
Post by: Xmair on Jan 18, 2018, 05:34 PM
Try changing: mysql_query(mysqlDB,"INSERT INTO `test` (id, username) VALUES("0", 'testt');");to
mysql_query(mysqlDB,"INSERT INTO `test` (id, username) VALUES(0, 'testt');");
Title: Re: MySQL query didn't execute.
Post by: Fratello on Jan 18, 2018, 07:48 PM
Oh, I totally forgot about that one. Prototype version of id was actually a string instead of current (int). So I forgot to change it.

Thanks!