QUERY
===============================================================
<cfquery name="getSurvey" datasource="#application.dsn#">
SELECT *
FROM surveys S, surveySub SB, categories C LEFT OUTER JOIN questions Q ON
(C.categoryID = Q.categoryID) LEFT OUTER JOIN questionsN QN ON (Q.questionID
= QN.questionID) LEFT OUTER JOIN questionsW QW ON (Q.questionID =
QW.questionID)
WHERE (S.surveyID = SB.surveyID AND SB.categoryID = C.categoryID)
</cfquery>
===============================================================
RECORD RETURNED
===============================================================
surveySubID categoryID category questionID question catOrder catweight
9 12 NOO NULL NULL 1 1
7 10 another one 1 building type 1 1
7 10 another one 2 building size 1 1
8 9 test 3 another question 1 1
===============================================================
CODE
===============================================================
<cfoutput query="getSurvey" group="categoryID">
subsurveyid: #getSurvey.surveySubID#<br>
cat: #getSurvey.category#<br>
catid: #getSurvey.categoryID#<br>
<input type="text" name="order_#getSurvey.categoryID#"
value="#getSurvey.catOrder#">
<input type="text" name="weight_#getSurvey.categoryID#"
value="#getSurvey.catOrder#">
<input type="checkbox" name="remove" value="#getSurvey.surveySubID#"><br>
Questions<br>
<cfoutput>Question: #getSurvey.question#<br></cfoutput>
Add question to this category
<br>
<hr>
</cfoutput>
PROBLEM
============================================================
catid: #getSurvey.categoryID#<br>
This line of code should be pumping out the categoryID returned in the
record set. It works fine as long as there is a question associated with
the category. However, if the category does not have a question associated
with it it returns a null. I thought I should at least get the categoryID
back if I did a LEFT JOIN. Any ideas?
Won
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists