19.02.2011, 16:31
I couldn't put the whole query in to one line as I got an error, I do this and it only inserts the data up to "Rank4Name".
pawn Код:
new string[256];
format(string, sizeof(string), "INSERT INTO groups (ID,Name,Rank1Name,Rank2Name,Rank3Name,Rank4Name) VALUES ('%d','%s','%s','%s','%s','%s')", rows += 1, GroupCreating[playerid][Name], GroupCreating[playerid][Rank1Name], GroupCreating[playerid][Rank2Name], GroupCreating[playerid][Rank3Name], GroupCreating[playerid][Rank4Name]);
mysql_query(string);
format(string, sizeof(string), "INSERT INTO groups (Rank5Name,Rank6Name,Rank7Name,Rank8Name,JoinRank) VALUES ('%s','%s','%s','%s','%d') WHERE Name='%d'", GroupCreating[playerid][Name], GroupCreating[playerid][Rank5Name], GroupCreating[playerid][Rank6Name], GroupCreating[playerid][Rank7Name], GroupCreating[playerid][Rank8Name], GroupCreating[playerid][JoinRank]);
mysql_query(string);