Posted by Pedro Graca on 01/26/06 01:17
Rachelle wrote:
<snip>
> is it possible to search like this:
>
> Repository #1
> ---Module #1 in Repo#1
> ------files in Module #1
> ---Module #2 in Repo #1
> ------files in Module #2 Repo #1
> etc.\
> \\
> \\
> \\
> Repository #2
> --Module #1 in Repo #2
> etc......
>
> is this possible to do a search under a search under a search with SQL
> PHP?????
SELECT not tested:
select <fields>
from repository r
join module m on r.rep_id = m.rep_id
join file f on m.mod_id = f.mod_id
where <conditions>
order by <whatever>
limit <something>
With this you'll get something like
rep_id | rep_name | mod_id | mod_name | file_id | file_name | ...
-------+----------+--------+----------+---------+-----------+----
1 | master | 1 | test | 1 | test.php | ...
1 | master | 1 | test | 2 | echo.php | ...
1 | master | 2 | environ | 3 | data.php | ...
2 | slave | 3 | listen | 4 | open.php | ...
....
Then use PHP to format the data however you like best :-)
Maybe putting it all in an array first will make it easier to format as
you need.
--
If you're posting through Google read <http://cfaj.freeshell.org/google>
[Back to original message]
|