Hi everyone, I'm having trouble figuring out what's going on with my code here:
mysql_select_db("kdb", $mysql_link);
$query = "SELECT * FROM ForumProfiles WHERE Email='".$_SESSION['Email']."'";
if ($result = mysql_query($query)) $row = mysql_fetch_assoc($result);
$new_balance = $row['Money']+1;
$p_id = $row['ID'];
$query = "UPDATE ForumProfiles SET Balance = $new_balance WHERE ID = '$p_id'";
if ($result = mysql_query($query)) $row = mysql_fetch_assoc($result);
The weird thing is that it does work, the php and the sql do exactly what I want them to, but it always returns this:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in...
If anyone can help me alleviate this problem I'd be very grateful, thanks!