PHP Nested Loop Tutorial

| User Level: | Beginner |
|---|---|
| Product: | Dreamweaver MX |
| Database: | MySQL |
| Server Model: | PHP ImpAkt 1(UD4), PHP MySQL (DWMX), PHP PHAkt 1 (UD4) |
| Browser: | All |
I
guess since you are looking for a nested loop "solution" you
already familiar with a simple database structure used in this method.
Create a recordset named "menu" to show only PARENT menu items which have SID value "0":
Insert dynamic text for MENU name field.
Create another
Recordset and name it "submenu".
Create a
second table under the first one, insert the Dynamic text from SUBMENU
"menuname" Recordset and apply REPEAT REGION to both
tables. Now go to
CODE VIEW and place the Recordset "submenu" under the closing
</table> tag of the parent menu item table. This procedure
could me much "cleaner" but i won't complicate things.
Now we will
loop the second table.
Next we are going to....hey, thats it!!!
|
User Reviews
Total of 11 reviewsAwesome.....
Written by Adrian Lord on November 13, 2009I just wanted to say a big THANKS for this tutorial. I have been looking for ages for a simple step by step guide on how to next tables within tables. I followed your guide (although I have separate tables for the 'menu' and 'submenu' parts) and it ...
SOLVED - THIS SOLUTION WORKS
Written by A. Hos on June 5, 2008Just read Chris Pfrang's post (10 January 2006, 10:51). I followed the tutorial THEN implemented his two small fixes/adjustments. It worked like a charm! Thank you Chris and Zo Zo.
RE: Review of Jayson's code
Written by student101 on May 19, 2008Works similar to my asp version.Thank you for taking the time. Cheers
Review of Jayson's code
Written by John Robertson on May 18, 2008Hi again Jayson. I compared our code and see why yours was not working. mysql_select_db($database_cnparent, $cnparent);$query_menu = 'SELECT * FROM parent WHERE sid = 0 ORDER BY menuname ASC';$menu = mysql_query($query_menu, $cnparent) or ...
RE: no code only pictures?
Written by John Robertson on May 18, 2008Greetings Jason Thank you for your persistance in wanting to find an answer to this article. For a long time (would you believe - now nearly TWO YEARS since I first asked the same question) I did not believe anyone could solve this (or want to - ...
RE: Has anyone been successful in making this tutorial work?
Written by student101 on May 18, 2008<?php require_once('../../Connections/cnparent.php'); ?><?phpif (!function_exists('GetSQLValueString')) {function GetSQLValueString($theValue, $theType, $theDefinedValue = '', $theNotDefinedValue = '') { $theValue = get_magic_quotes_gpc() ...
no code only pictures?
Written by student101 on May 17, 2008Pretty poor, due to no real code and only pictures, nobody can get this to work the way you have explained. Post your entire page, love to see what that looks like? Cheers
















