hello...for some reaosn whenever i ask my query to do someting, like update or insert...it like doubles it...like if i ask to up date a user's points -2 it will do it -4 ...then when i want to insert something else...it will insert it twice into a row...is this a fixable error?heres my code for the UPDATE...
mysql_query("UPDATE users SET points=$user_points - $costofitem WHERE username='$auth_user'");
now my first thought was ok. np...i just pressed 4....but ived asked to echo the $costofitem and it says 2....
then heres my insert
mysql_query("INSERT INTO inventory (owner, item_id, item_name) VALUES ('$auth_user', '$wanteditem', '$item_name1')");
thanks for ur help.
heres the full code of it...
$wanteditem = $_GET['item'];
$wanteditem1 = $wanteditem;
$result_user = mysql_query("SELECT * FROM users WHERE username='$auth_user'");
$user_info = mysql_fetch_array($result_user);
$user_points = $_SESSION['user_points'];
$resultitem = mysql_query("SELECT * FROM items WHERE item_id='$wanteditem'");
$item_info = mysql_fetch_array($resultitem);
$costofitem = $item_info['item_cost'];
mysql_query("UPDATE users SET points=$user_points - $costofitem WHERE username='$auth_user'");
mysql_query("INSERT INTO inventory (owner, item_id, item_name) VALUES ('$auth_user', '$wanteditem', '$item_name1')");
i jus copied/pasted those codes from my script...so their not rlly in order..