简体   繁体   中英

tree structure+php

I want to display a list of contents.and when i click on a particular content it should show the sub contents..like a tree structure..another requirement is all these contents are from a MYSQL database..(phpmyadmin)

  • I have 2 tables,table 1 contains 2 fields namely code and content name.

  • table 2 contains 2 fields namely parent code and child code (both of these code are the same as code of table 1)

when i click on a particular content,it should take the corresponding code from table 1 and check whether that code is there in the field 'parent code' of 2nd table.If so,take the child code,and search for the content name in table 1 and display under the parent content. similarly it should go on...

i fetched all the contents using the code:

$ps=$this->Table1->find('all',
     array('fields'=>array('id','contentcode','contentname'),
    'conditions'=>$conditions)); 
$this->set('collections',$ps);

i passed it to the view.ctp, but dont know how to display

i am using cakephp,

thanks in advance..

如果是我,我只会用phplayersmenu

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM