i want to run this loop adding as many g$g's as there is in $row6 What is wrong with this?
$g = 1; $result6 = mysql_query ("SELECT * from results_data where group_id = $latest_group_id"); while ($row6 = mysql_fetch_array($result6)) { $resultid= $row6[result_id]; $userid = $row33[id]; $result = mysql_query ("update tippingresults set choice = 'g$g' where resultid = '$resultid' and userid = '$userid'") or die("INSERT error0: ".mysql_error()); $g ++;
Well, either you pasted a snippet or you left out a missing '}' to close the while() statement. Either way, double check that.
Also, what is happening? If its only doing g1, is there perhaps only one row returned?