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:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old September 7th, 2003, 06:40 PM
velocityX velocityX is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 72 velocityX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 36 sec
Reputation Power: 6
Send a message via AIM to velocityX
Something wrong with PHP loop code

Whats wrong...?
PHP Code:
<?
include ('forum_db.php');

$DB mysql_connect(localhost,$username,$password);
@
mysql_select_db($database) or die( "Unable to select database");
$query "select * from forum_category order by category_id";
$result=mysql_query($query);

$num=mysql_numrows($result);

$i=0;
while (
$i $num) {

  
$cat_title=mysql_result($result,$i,"title");
  
$cat_id=mysql_result($result,$i,"category_id");

?><b><u><?=$title?></u></B><br><?

  $query2 
"select section_id, title, description from forum_sections where category_id = $cat_id";
  
$result2=mysql_query($query2);


  
$num2 mysql_numrows($result2);

  
$m=0;
  while (
$m $num2) {

    
$sec_id=mysql_result($result2,$m,"section_id");
    
$sec_title=mysql_result($result2,$m,"title");
    
$sec_description=mysql_result($result2,$m,"description");

    
?>
<?=$sec_title?>
<br>
<?=$sec_description?><br>
    <?

    
++$m;
  }

?><br><?

  
++$i;
}
?>

Reply With Quote
  #2  
Old September 8th, 2003, 06:48 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
You tell us. What does it or doesn't it do?

Reply With Quote
  #3  
Old September 8th, 2003, 07:11 PM
velocityX velocityX is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 72 velocityX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 36 sec
Reputation Power: 6
Send a message via AIM to velocityX
never mind, I've fixed it

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Something wrong with PHP loop code


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 3 hosted by Hostway