Just had a quick look, don't you need to loop get_extension as you loop get_report_details? You could just join the tables up?
Andy ------------------------------------------------------- RAWNET LIMITED - Internet, New Media and ebusiness Gurus Visit our new website at http://www.rawnet.com for more information about our company, or call us anytime free on 0800 2942424. ------------------------------------------------------- Andrew Levett Web Application Developer, Rawnet Limited Telephone : +44 (0) 1344 393 040 Web : http://www.rawnet.com ------------------------------------------------------- This message may contain information which is legally privileged and/or confidential. If you are not the intended recipient, you are hereby notified that any unauthorised disclosure, copying, distribution or use of this information is strictly prohibited. Such notification notwithstanding, any comments, opinions, information or conclusions expressed in this message are those of the originator, not of rawnet limited, unless otherwise explicitly and independently indicated by an authorised representative of rawnet limited. ------------------------------------------------------- > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: 18 September 2003 15:57 > To: [EMAIL PROTECTED] > Subject: [ cf-dev ] I just can't do it capt'n > > > > I'm sure that this is a database design problem but as I have > little control over that how can I solve this problem ....? > > The following code produces a link to a document ...... > The link is made up like this > /reports/<year>/<phase>/<path>/<school>/<school>.<extension> > > phase = primary > secondary > > path = path in database (eg ks1va) > > School = School DFEE No > > Extension = .pdf .doc.xls etc > > So the problem is this. The database has a table called > Report details. This table has an entry thus ... > > Report_ID Group_ID ReportName Doc_Type_ID Doc_Path Phases > 8 6 abc 1 fndation 24 > 9 6 def 3 barchart 2 > > Using the code below all is cool and both reports show as links. > > eg. > /reports/2003/primary/fndation/2000/2000/abc.pdf > /reports/2003/primary/barchart/2000/2000/def.pdf > > However both links have the extension .pdf where the first > should have .pdf and the second .xls I can see that the query > looping is causing the problem but how can I fix it .....? > > > Regards - Paul (I hope I have explained this one ok) > > > <cfif isdefined ("url.group_ID")> > <CFQUERY NAME="get_Phase_ID" > DATASOURCE="WebUserDSN"> > SELECT * > FROM Phases > WHERE Phase = '#url.phase#' > </CFQUERY> > > <CFQUERY NAME="get_Report_Details" > DATASOURCE="WebUserDSN"> > SELECT * > FROM Report_Details > WHERE Group_ID = '#url.group_ID#' and Phases like ('% > #get_Phase_Id.phase_ID#%') > </CFQUERY> > > <CFQUERY NAME="get_extension" > DATASOURCE="WebUserDSN"> > SELECT * > FROM Doc_Type > WHERE Doc_Type_ID = '#get_report_details.doc_type_ID#' > </CFQUERY> > > > <cfif get_report_details.recordcount gt 1> > <tr> > <td valign="top" width="580" align="center" style > ="font-family: Arial; font-size: 10pt"> > <br><!--mstheme--><font face="arial, Arial, > Helvetica" size ="2"> > Please select a report group from the list below<p></p> > <cfoutput query="get_report_details"> > <a href > ="reports/#url.year#/#url.phase#/#doc_path#/#url.school#/#url. school##get_extension.doc_type#"> > #Report_Name#</a><br> > </cfoutput> > > > > > ************************************************************** > *********************************** > The information contained within this e-mail (and any > attachment) sent by Birmingham City Council is confidential > and may be legally privileged. It is intended only for the > named recipient or entity to whom it is addressed. If you are > not the intended recipient please accept our apologies and > notify the sender immediately, or telephone +(44) 121 303 > 6666. Unauthorised access, use, disclosure, storage or > copying is not permitted and may be unlawful. Any e-mail > including its content may be monitored and used by Birmingham > City Council for reasons of security and for monitoring > internal compliance with the office policy on staff use. > E-mail blocking software may also be used. Any views or > opinions presented are solely those of the originator and do > not necessarily represent those of Birmingham City Council. > We cannot guarantee that this message or any attachment is > virus free or has not been intercepted and amended. > > ************************************************************** > *********************************** > > > -- > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] For human help, e-mail: > [EMAIL PROTECTED] > > > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
