MYSQL String
#1

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

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

Thanks I'm gonna try it!
Reply
#4

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

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

Your welcome and Merry Christmas to you too!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)