Jump to content

php/mysql help to show data from two tables in drill down manner


siddiquip

Recommended Posts

Hi,

I would be grateful if anybody can help me ........this is driving me crazy ???. I have two tables  Files and FileFiles.

The file Table stores information about the files in the table with File_Id as the primary key and File_Type as the type field indicating the type of files(it can hav values 1,2,3,4)

The FileFiles tables contains the relations between files with two fields parent_id and include_id (both primary keys) .Now if a file having file_id as 21 is using file having file_id 22  which in turn uses file having file_id 23

the filefiles table is filled as follows

          parent_id    include_id

            21                    22

            22                    23

The thing is that files having file_type

as 1 will not include any files

as 2 will include files having type 3 /4 or both

as 3 can have  files having type 3/4 or both

as 4 will not include any files

 

now in the main page of files whenever i select any file ( having any type and id ) it should show me any connections it is having to all the files in a hierarcy like if i select 23 then it should show me

23->22->21in a drill down fashion

similarly if i select 21 it should give me connctions as 21->22->23

similarly if 22 is selected the selection should be as 21<-22->23

i want to implement the code in php.Also can this be implemented in mysql directly.i'm using mysql 4

any help would be great

thanks in advance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.