22.01.2012, 07:45
(
Последний раз редактировалось ombre; 22.01.2012 в 09:09.
)
Hello,
I want to check some variable and if X variable= ... update. I use while(mysql_retrieve_row(). In the debug it work's, but the update don't work. Thanks.
I want to check some variable and if X variable= ... update. I use while(mysql_retrieve_row(). In the debug it work's, but the update don't work. Thanks.
Код:
format(query,sizeof(query),"SELECT `Name`, `Level` FROM `players` WHERE `Active`=0"); mysql_query(query); mysql_store_result(); while(mysql_retrieve_row()) // or other? { new str[11]; new pname[26]; new pname2[26]; new lvl; mysql_fetch_field_row(str, "Level"); lvl = strval(str); mysql_fetch_field_row(pname, "Name"); strmid(pname2,pname, 0, strlen(pname), 26); printf("%s",pname2); if( lvl< 16) //don't work { format(query,sizeof(query),"UPDATE `players` SET `Level` = 1 WHERE `Name` = '%s'",pname2); //remove file with pname2 } } ...