select - sql - selecting, counting and Updating -
i'm wondering if correct...
i want select users teams in match , add win, loose or draw profile.
$short = $_post['short']; $opponent = $_post['opponent']; $oppuser = safe_query("select userid ".prefix."teams_members teamid='".$opponent."'"); $shortuser = safe_query("select userid ".prefix."teams_members teamid='".$short."'"); safe_query("update ".prefix."teams_members set win=win+1 userid='".$oppuser."'"); safe_query("update ".prefix."teams_members set lost=lost+1 userid='".$shortuser."'");
something not allowing updating rows.
you don't need selects. update not working because select statement returning multiple entries. can update entire team without selecting users:
$short = $_post['short']; $opponent = $_post['opponent']; safe_query("update ".prefix."teams_members set win=win+1 teamid='$opponent'"); safe_query("update ".prefix."teams_members set lost=lost+1 teamid='$short'");
Comments
Post a Comment