Skemcin Posted February 13, 2008 Share Posted February 13, 2008 You need three tables:documentdoc_IDdoc_namedoc_description...categorycat_IDcat_namecat_description...document_x_categorydxc_IDdxc_doc_IDdxc_cat_ID... <cfquery name="qryGetDocs" datasource="#dbname#" username="#dbuser#" password="#dbpw#">SELECT doc_id, doc_name, doc_description, cat_nameFROM documentJOIN document_x_category ON dxc_doc_ID = doc_IDJOIN category ON cat_id = dxc_cat_idWHERE doc_id = #val(url.doc_ID)#ORDER BY cat_name</cfquery>...<hr><cfoutput query="qryGetDocs" group="cat_name"><strong>#cat_name#</strong><br /><cfoutput>#doc_name# <em>(#doc_ID#)</em><br />#doc_description#<br /><br /></cfoutput><hr></cfoutput> That should do it . . . Link to comment Share on other sites More sharing options...
Skemcin Posted February 14, 2008 Share Posted February 14, 2008 P.S. take the "WHERE" clause out and it will list all your documents grouped by category. Link to comment Share on other sites More sharing options...
vchris Posted February 21, 2008 Author Share Posted February 21, 2008 I'm done with the app! They're just gonna review it. I might have to add or change a couple things here and there but the hard work is done.I'm pretty happy about it. Link to comment Share on other sites More sharing options...
Skemcin Posted February 21, 2008 Share Posted February 21, 2008 Nice:) Link to comment Share on other sites More sharing options...
vchris Posted February 22, 2008 Author Share Posted February 22, 2008 Thanks for all your help buddy Link to comment Share on other sites More sharing options...
Skemcin Posted February 22, 2008 Share Posted February 22, 2008 My pleasure. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.