bank problem
#2

Код:
mysql_real_escape_string(inputtext,inputtext);
format(query,sizeof(query),"SELECT bankAccMoney FROM players WHERE username = '%s'",inputtext);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() == 0)
{
mysql_free_result();
//username doesn't exist, send error msg
}
else
{
mysql_free_result();
//username does exist..
format(query,sizeof(query),"UPDATE players SET bankAccMoney = bankAccMoney + moneyTransferred WHERE username = '%s'",inputtext);
mysql_query(query);
}
rep
Reply


Messages In This Thread
bank problem - by Tanush123 - 03.01.2012, 03:28
Re: bank problem - by coole210 - 03.01.2012, 06:04

Forum Jump:


Users browsing this thread: 2 Guest(s)