php - Updating a row number which has been randomised -
so have random number being generated in php , want know how go updating row number in selected table. code below:
$sxiq = mysql_query("select * `starting_eleven` `team_id`=$uid"); $sxir = mysql_fetch_row($sxiq); $first = rand(1,11); $stat_changed = rand(11,31); $up_or_down = rand(1,2); if ($up_or_down == 1) { $player_name = explode(" ", $sxir[$first]); $fn = $player_name[0]; $ln = $player_name[1]; $statq = mysql_query("select * `players` `first_name`=$fn , `last_name`=$ln , `user_id`=".$_session['user_id']); $statr = mysql_fetch_row($statq); $stat = $statr[0]; }
i update row $stat_changed database, i'm not sure if possible without doing long if statement, telling code if $stat_changed = 13 $stat = pace or along lines, if way must done i'll have to. thought i'd see if there other simpler ways of doing this.
thanks in advance
if ($stat_changed == 13) { //insert update statement here }
Comments
Post a Comment