MYSQL PROBLEM
#1

Hi! Why dosent this work?? It should save.. But it dosent. when I relog it get removed..

Please help

pawn Код:
new var[32];
                for (new i = 1; i < 11; i++)
                {
                    format(var, sizeof(var), "`clothBone%d` = '%d', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothBone][i]);

                    format(var, sizeof(var), "`clothSlot%d` = '%d', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot][i]);

                    format(var, sizeof(var), "`clothSlot%d_X` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_X][i]);

                    format(var, sizeof(var), "`clothSlot%d_Y` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_Y][i]);

                    format(var, sizeof(var), "`clothSlot%d_Z` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_Z][i]);

                    format(var, sizeof(var), "`clothSlot%d_RX` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_RX][i]);

                    format(var, sizeof(var), "`clothSlot%d_RY` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_RY][i]);

                    format(var, sizeof(var), "`clothSlot%d_RZ` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_RZ][i]);

                    format(var, sizeof(var), "`clothSlot%d_SX` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_SX][i]);

                    format(var, sizeof(var), "`clothSlot%d_SY` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_SY][i]);

                    format(var, sizeof(var), "`clothSlot%d_SZ` = '%f', ", i);
                    formatcat(query, var, ClothingInfo[playerid][clothSlot_SZ][i]);

                    format(var, sizeof(var), "`clothingName%d` = '%s', ", i);
                    formatcat(query, var, ClothingName[playerid][i]);
                }
Reply
#2

What is formatcat?
Reply
#3

pawn Код:
#define formatcat(%1,%2,%3) do { new _str[255]; format(_str, 255, %2, %3); strcat(%1,_str); } while(FALSE)
Reply
#4

If you feel the need to append numbers to field names then your table structure is a mess. Use less columns and more rows. For your sake I hope that this isn't the main player table either. You should be looking at a structure like:

userid slotid bone x y z rx ry rz sx sy sz name
1 1 2 0 0 0 0 0 0 0 0 0 foo
1 4 1 0 0 0 0 0 0 0 0 0 bar
Reply
#5

Yes but that no slove problem
Reply
#6

BUMP
Reply
#7

print that whole string after formating and post it here, I think you are missing commas (,) after each column.
Reply
#8

put mysql_debug(1)
and tell us what you get from that query.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)