In this line:
mysql_query("UPDATE user_pokemon SET belongsto=".$row2['trade_from']." WHERE id='".$row2['trade_mypokeid']."'")
you forgot to specify the first parameter:
mysql_query("UPDATE user_pokemon SET belongsto='".$row2['trade_from']."' WHERE id='".$row2['trade_mypokeid']."'")
The same error occurs in the following two mysql_query in the code.
You know this, but I’ll say it anyway: use PDO or mysqli . At the very least, sanitize all your data with mysql_real_escape_string , as you did at the beginning of your code.
mysql_query("UPDATE user_pokemon SET belongsto='".mysql_real_escape_string($row2['trade_from'])."' WHERE id='".mysql_real_escape_string($row2['trade_mypokeid'])."'")
I just say this because it will help you in the long run that everything
source share