问题描述:

I have this table: tbl_module_bid

image:

you see users: Ali2,Ali,blackbone,dickface,mhmd

let's call for each one of them it's called $player and the sql query I wanna use in:

mysql_query("UPDATE `bbcsystem`.`tbl_admin` SET games_played = games_played + 1 WHERE username = $player");

I also don't want them to be duplicated

I tried using this script below:

//Update Game Played (not working very good):

$num_qry = "Select DISTINCT * From tbl_module_bid where user = '".$_SESSION['LOGIN_BALANCE_FRONT']['name']."' AND module = '$mod_id' order by bid asc";

$get_pick = $db->get_results($num_qry,ARRAY_A);

foreach($get_pick as $arr_pic)

{

$player = $arr_pic['user'];

mysql_query("UPDATE `bbcsystem`.`tbl_admin` SET games_played = games_played + 1 WHERE username = $player");

}

相关阅读:
Top