03.01.2012, 06:04
Код:
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); }