Advanced Search

Results 1 to 1 of 1

Thread: Populating Array....

  1. #1
    Join Date
    Nov 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Populating Array....

    Hi all,

    First post, Hope I can explain myself and also recive a quick response.

    My website has categories and subcategories, for example News is Cat1 Subcat0, Sport-News is Cat1 Subcat1, Travel-News is Cat 1 Subcat2, Restaurants is Cat2 Subcat0, Italian-Restaurants is Cat2 Subcat1, etc...

    In the Mysql DB there is a field called url_modrewrite, that I want to fetch. Ive figuered out how to fetch and populate an array only looking at the Category, but not both the Category and the Subcategory...

    PHP Code:
     $sql mysql_query("SELECT url_modrewrite, cat, subcat FROM content WHERE port = '$port' AND lang = '$lang' AND ubic_menu LIKE '%sup%' ");
    $data = array();
    //populate array with modrewrites
    while($d mysql_fetch_array($sql)){
    $data[$d['cat']] = $d['url_modrewrite'];

    After I want to printf the value of url_modrewrite: print_r($data[1]);

    How could I change the code so I also control the Subcategories!¿

    Muchas muchas Gracias x adelantado ( Something like thx in advanced )
    Last edited by bunker; 11-26-2008 at 05:35 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •