// add to the weight and item arrays below $weight[0] = 1; $item[0] = "Try Again 1"; $weight[1] = 1; $item[1] = "Try Again 2"; $weight[2] = 1; $item[2] = "Try Again 3"; // end of arrays for ( $a=0; $a<count($weight); $a++ ) for ( $b=1; $b<=$weight[$a]; $b++ ) $pick[] = $a; $selected = $item[$pick[rand(0,count($pick)-1)]]; echo $selected;
But instead of having it say "Try Again" execute some SQL like this:
mysql_query("UPDATE Users SET Back1 = '1' WHERE UserID='$user'");
EDIT:
I forgot the weight value is VERY important.
This post has been edited by RayRayAngel: 18 December 2008 - 04:35 AM

New Topic/Question
Reply




MultiQuote







|