SA-MP Forums Archive
MYSQL String - 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: MYSQL String (/showthread.php?tid=402072)



MYSQL String - Scofield62 - 25.12.2012

Hi all! I've got this code:

Код:
new string[128];
format(string, sizeof(string), "INSERT INTO `Vehicles` (ID,Carname,Numberplate,X_Chord,Color) VALUES ('%d','%s','%s','%f','%d')",carid, VehicleNames[carid-400], inputtext, X_Chord, color);
mysql_query(string);
But when i try insert one more thing into a column it doesn't do that, it has some kind of limit or what? How can i avoid it?

For Example this
Код:
new string[128];
format(string, sizeof(string), "INSERT INTO `Vehicles` (ID,Carname,Numberplate,X_Chord,Color,Y_Chord) VALUES ('%d','%s','%s','%f','%d','%f')",carid, VehicleNames[carid-400], inputtext, X_Chord, color,Y_Chord);
mysql_query(string);
So it doesn't work


Re: MYSQL String - nGen.SoNNy - 25.12.2012

Try to use this.. if it's not working try tu enable ( mysql_debug(1); )
pawn Код:
new string[512];
format(string, sizeof(string), "INSERT INTO `Vehicles`(`ID`, `Carname`, `Numberplate`, `X_Chord`, `Color,Y_Chord`) VALUES(%d,'%s','%s','%f', %d,'%f')",carid, VehicleNames[carid-400], inputtext, X_Chord, color, Y_Chord);
mysql_query(string);



Re: MYSQL String - Scofield62 - 25.12.2012

Thanks I'm gonna try it!


Re: MYSQL String - Konstantinos - 25.12.2012

128 is the limit on the chat messages, not on the SQL queries. You can use greater size of the string, because if the query is too short, then it won't insert/update or whatever you want to do.


Re: MYSQL String - Scofield62 - 25.12.2012

Thanks for helping guys! Now it works! Thanks so much Merry Christmas ! =)


Re: MYSQL String - Konstantinos - 25.12.2012

Your welcome and Merry Christmas to you too!