Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old April 13th, 2004, 01:03 PM
Abysmal Abysmal is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 Abysmal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 sec
Reputation Power: 0
A sql query..

I have just jumped into the world of php/mysql and of course my first proect has already stumpped me..

I desperatly need help with a query..

I am trying to convert a cd cataloging utility from vb/cdo to php/mysql..

I have a data structure setup and I am getting confused with the query to retreive the data from the 3 tables it is spread accross..

Basicly the 3 tables are CD, DIRECTORY and FILES .. my problem comes into play because a directory can contain a directory and be numerous levels down.. (we all know what a directory tree looks like)..

Any ideas??

Abysmal - Dazzed and Confused in SQL Hell..

Reply With Quote
  #2  
Old April 13th, 2004, 08:04 PM
-vertigo- -vertigo- is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Louth, Lincolnshire
Posts: 314 -vertigo- User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 24 sec
Reputation Power: 2
RE: A sql query..

Each CD will only point to one directory, the root directory. It will also have such information as the CD title, etc.

You directory table stores a directories and possibly a link to the parent directory (if one exists). Then you have an associative table from directory to itself, with links from directories to directories.

In your files table you have all the files and a key to the directory to which it belongs.

Then when you want to find what is on a CD, you simply get it's directory code and then get the directories and files that belong to it. Do you have a problm with this query? It isn't too difficult, as long as you understand what the tables are for.

select * from subdir where parent_dirid=10;
select * from files where dirid=10;

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > A sql query..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT