Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 20
Braincode mempunyai hidup yang Normal
Default ASK PHP tolongin kk

Quote:





echo '
  • ';

    echo '
  • Main Menu';



    while ($row = mysql_fetch_array($result)){

    extract ($row);

    echo '
  • '.$row[category_name].'';



    echo '
    • ';

      $query2 ='select * from sub_category where category_id='.$row[id_category];

      $hasil =mysql_query($query2,$db)or die(mysql_error($db));

      while ($r = mysql_fetch_array ($hasil)){

      extract ($r);

      echo '
    • '.$r[sub_category_name].'';

      echo'
      • ';

        $query2 ='select * from product where sub_category_id='.$r[id_sub_category];

        $hasil =mysql_query($query2,$db)or die(mysql_error($db));

        while ($r = mysql_fetch_array ($hasil)){



        echo'
      • '.$r[product_name].'';

        }



        echo'
      ';







      }

      echo'
    ';



    }



    ?>










kk saya mau menampilkan menu dengan 3 level ,

ex:

category1 --> sub_category1 --> product1

category2





tapi untuk tiap tabel cuma keluar 1 data , masalahnya dimana yah kk , karena kalau 2 level , tanpa product gk ada masalah ,



mohon bantuanya



Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 03:01 AM.


no new posts