[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic Multi Level Drop Down Menu in PHP/MYSQL



$sql = "SELECT * FROM menu";
$rows = mysql_query($sql, $con);

if(mysql_num_rows($rows > 0)){

while($record = mysql_fetch_array($rows)){
$title = $record["title"];
echo "<li>$title</li>";


}


}

On Tue, Jun 1, 2010 at 10:57 PM, Joe Forsythe
<jforsythe@xxxxxxxxxxxxxxxxxx>wrote:

>
>
> What is the PHP code that you're using right now?
> --
> Joe
>
>
> On Jun 1, 2010, at 10:41 AM, Sovichea SOU wrote:
>
> > Hello Joe,
> >
> > Thanks for your fast reply.
> >
> > I can loop only like this:
> >
> > <ul>
> > <li>Item1</li>
> > <li>Item2</li>
> > <li>Item2a</li>
> > <li>Item2b</li>
> > </ul>
> >
> > It should be look like this with nested list:
> >
> > <ul>
> > <li>Item 1</li>
> > <li>Item 2
> > <ul>
> > <li>Item 2a</li>
> > <li>Item 2b</li>
> > </ul>
> > </li>
> > </ul>
> >
> > This is database:
> >
> > id - title - link - parentid
> > 1 - Item1 - http://www.yahoo.com - 0
> > 2 - Item2 - http://www.google.com - 0
> > 3 - Item2a - http://www.chhit.com - 2
> > 4 - Item2b - http://www.gmail.com - 2
> >
> > Could you tell me how to write this kind of loop?
> >
> > Thanks,
> >
> > Vichea
> >
> > On Tue, Jun 1, 2010 at 10:29 PM, Joe Forsythe
> > <jforsythe@xxxxxxxxxxxxxxxxxx <jforsythe%40mosaiccreative.com>>wrote:
> >
> > >
> > >
> > > "The problem is that I cannot loops with php."
> > >
> > > I'm not sure I know what this means. Do you know how to write a loop
> > > in PHP?
> > > --
> > > Joe
>
> [Non-text portions of this message have been removed]
>
>  
>


[Non-text portions of this message have been removed]



------------------------------------

Are you looking for a PHP job?
Join the PHP Professionals directory Now!
http://www.phpclasses.org/jobs/
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-objects/join
    (Yahoo! ID required)

<*> To change settings via email:
    php-objects-digest@xxxxxxxxxxxxxxx 
    php-objects-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux