Mysql update question, important.
#1

How can I update in the sql like something.
like I want to edit player stats when he's offline, to add cash not set.

pawn Код:
format(query, sizeof(query), "SELECT `cash` FROM `users` WHERE `name` = '%s'", name);
mysql_function_query(dbHandle, query, true, "AddPlayerMoney", "ii", name, cash);

The cache:
forward AddPlayerMoney(name[], cash);
public AddPlayerMoney(name[], cash)
{
    new rows, fields, cash2, query[256];
    cache_get_data(rows, fields);
    cash2 = cache_get_row_int(0, 5);
    cash += cash2;
    format(query, sizeof(query), "UPDATE `users` SET `cash` = %d WHERE `name` = '%s'", cash, name);
    mysql_function_query(dbHandle, query, true, "", "");
}
it doesn't works.
Reply


Messages In This Thread
Mysql update question, important. - by PaulDinam - 24.03.2013, 00:08
Re: Mysql update question, important. - by ReneG - 24.03.2013, 00:17
Re: Mysql update question, important. - by Maxips2 - 24.03.2013, 00:19
Re: Mysql update question, important. - by PaulDinam - 24.03.2013, 00:20
Re: Mysql update question, important. - by Maxips2 - 24.03.2013, 00:24
Re: Mysql update question, important. - by ReneG - 24.03.2013, 00:32

Forum Jump:


Users browsing this thread: 4 Guest(s)