cheva
Power Member
- Aug 22, 2009
- 557
- 761
whats wrong with this code :S
when i test postback for a given uid, the points get updated, but they keep adding after every couple of minutes.
Its supposed to update the points once, and then close the statement.
im no php guru so sum insight wud be appreciated
Code:
mysql_connect($mysql_where, $mysql_username, $mysql_password);
mysql_select_db($mysql_database);
/*
* test postback
*/
include("includes.php");
$new = $_REQUEST['new'];
$uid = $_REQUEST['uid'];
$total = $_REQUEST['total'];
$oid = $_REQUEST['oid'];
//$query_getuserid = mysql_query("SELECT id from members WHERE username= '".$uid."'") or die(mysql_error());
//foreach(mysql_fetch_array($query_getuserid) as $userid);
mysql_query("UPDATE members SET points=points+".$new." WHERE username='".$uid."'");
mysql_close();
echo "Success: ".$uid." earned ".$new." points\n";
when i test postback for a given uid, the points get updated, but they keep adding after every couple of minutes.
Its supposed to update the points once, and then close the statement.
im no php guru so sum insight wud be appreciated