MySQL Looping
#7

Looking at your code:
pawn Код:
new string[128], pNm[MAX_PLAYER_NAME], convert[50], var;
mysql_query("SELECT `name` FROM `players` WHERE `var1` > 1 AND `var2` != 1");
mysql_store_result(); //Store the result
while(mysql_fetch_row(pNm)) {
    format(string, sizeof(string), "SELECT `var1` FROM `players` WHERE `name`='%s'", playersName);
    mysql_query(string);
    mysql_store_result(); //Store the result over the previous result
    mysql_fetch_row(convert);
    var = strval(convert);
    format(string, sizeof(string), "UPDATE `players` SET `var1`='%d' WHERE `name`='%s' AND `var2`!=1", var-45, pNm);
    mysql_query(string);
}
I think your problem is over there.
Reply


Messages In This Thread
MySQL Looping - by SuperViper - 11.12.2011, 17:54
Re: MySQL Looping - by GamingTurf - 11.12.2011, 17:58
Re: MySQL Looping - by SuperViper - 11.12.2011, 17:59
Re: MySQL Looping - by GamingTurf - 11.12.2011, 18:08
Re: MySQL Looping - by Kingunit - 11.12.2011, 18:09
Re: MySQL Looping - by SuperViper - 11.12.2011, 18:18
Re: MySQL Looping - by Hiddos - 11.12.2011, 18:21
Re: MySQL Looping - by SuperViper - 11.12.2011, 18:24

Forum Jump:


Users browsing this thread: 1 Guest(s)