|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
i have problem with looping. do u know what is my problem is?? i delete a single row in my page like prize of rank number 3,then it carried the value the value of the prize rank number 2. it's ok if all row of my table is filled with the prize, but when user delete, it show the value which is not in my database regard with it's rank.
for($thisprize=1; $thisprize<=$RANK; $thisprize++) // $thisprize represents the ranking. { $trial = "SELECT ContestID, Prize FROM Prizes WHERE ContestID=$c_id and Rank=$thisprize"; $query_trial = mysql_query($trial); while($data = mysql_fetch_array($query_trial)) { $myprize = $data["Prize"]; } echo " <tr>\n"; echo " <td width=\"10%\" align=\"center\" nowrap>$thisprize</td>\n"; if(!empty($myprize)) { echo " <td width=\"30%\" align=\"center\" nowrap>$myprize</td>\n"; echo " <td width=\"30%\" align=\"center\"><a href=\"editthisprize.php?c_id=$c_id&RANK=$thisprize\">Edit</a>  "; echo "<a href=\"deletethisprize.php?c_id=$c_id&RANK=$thisprize\" name=\"delete\">Delete</a></td>\n"; } else { echo " <td width=\"30%\" align=\"center\"> </td>\n"; echo " <td width=\"30%\" align=\"center\"><a href=\"fillPrize.php?contestid=$c_id&rank=$thisprize\">Add</a></td>\n"; } } |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > looping problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|