PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old August 4th, 2004, 09:02 PM
eddynazrul eddynazrul is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: 192.168.1.4
Posts: 21 eddynazrul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation looping problem

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>&nbsp&nbsp";
echo "<a href=\"deletethisprize.php?c_id=$c_id&RANK=$thisprize\" name=\"delete\">Delete</a></td>\n";
}
else
{
echo " <td width=\"30%\" align=\"center\">&nbsp</td>\n";
echo " <td width=\"30%\" align=\"center\"><a href=\"fillPrize.php?contestid=$c_id&rank=$thisprize\">Add</a></td>\n";
}
}

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > looping problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway