Storing Scores using mysql

Step 1 Gather stats

 * $query = "SELECT health,money,active FROM #__jigs_players WHERE iduser = ".$user->id
 * $db->setQuery($query);
 * $result		= $db->loadRow;
 * $player_health	= $result[0];
 * $player_money	= $result[1];
 * $player_status	= $result[2];

Step 2 Adjust stats based on outcome

 * $player_health	= $player_health -1;
 * $char_health	= $char_health-30;
 * $player_money	= $player_money + $char_money ;

Step 3 Save new stats to database

 * $db->setQuery("UPDATE #__jigs_inventory SET #__jigs_inventory.player_id = " . $user->id . " WHERE #__jigs_inventory.player_id = " . $player_id );
 * $result		= $db->query;
 * $db->setQuery("UPDATE #__jigs_players SET nbr_kills=nbr_kills+1, money = $player_money WHERE #__jigs_players.iduser = " . $user->id ) ;