MySQL query didn't execute.

Started by Fratello, Jan 18, 2018, 02:25 PM

Previous topic - Next topic

Fratello

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!

Xmair

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');");

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Fratello

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!