The object of all of this is to create a table that lists a document title, it’s file type, size, and the date it was last modified sorted by sections and grouped by category grouped by project for each client.
I can get bits and pieces but then I start confusing myself! For example,
SELECT * FROM (documents left join document_sections on documents.document_id = document_sections.document_id) left join sections on document_sections.section_id = sections.section_id;
gets me the title, type, size, date modified, and section. And I can retrieve title, type, size, date, and category or title, type, size, date, and project, etc.
I start getting confused (or maybe I’m already confused!) trying to figure out how to “join” it altogether.
I would GREATLY appreciate any nudges in the right direction.
Thanks so much!
Cheers!
deb
The web hosting company we’re using has mysql server version 4.1.14
Here are the pertinent tables in the database.
categories
category_id int(11) Not Null auto_increment
category varchar(50) Not Null
PRIMARY KEY: category_id
clients
client_id int(11) Not Null
username varchar(20) Not Null
pass varchar(50) Not Null
client_name varchar(40) Not Null
PRIMARY KEY: client_id
document_categories
doc_cat_id int(11) Not Null
document_id int(11) Not Null
category_id int(11) Not Null
PRIMARY KEY: doc_cat_id
document_sections
doc_sec_id int(11) Not Null
document_id int(11) Not Null
section_id int(11) Not Null
PRIMARY KEY: doc_sec_id
documents
document_id int(11) Not Null
document_name varchar(60) Not Null
document_type varchar(30) Not Null
document_size varchar(15) Not Null
date_last_modified date Not Null
project_id int(11) Not Null
date_entered timestamp Not Null
description varchar(100) Not Null
filename varchar(30) Not Null
PRIMARY KEY: document_id
projects
project_id int(11) Not Null
project_name varchar(60) Not Null
client_id int(11) Not Null
PRIMARY KEY: project_id
sections
section_id int(11) Not Null
section varchar(20) Not Null
PRIMARY KEY: section_id