Question
two tables and using a CFIF tag
Hi can someone help with this PLEASE?
There are 4 tables. schools, subjects, schools_subjects and subject_description
The relevant fields for these tables are as follows:
schools: School, SchoolID
schools_subjects: SchoolID, SubjectID
subject_description: Subject_descriptionID, SubjectID, SchoolID, Subject
I am trying to put something together to do this:
when someone SEARCHES for a school BY subject, it will give ALL the schools (link) that offer that particular Subject and also give the relevant subject_description (link). However it would also need to say ‘no description avilable’(linked to relevant school), IF there is no corresponding subject_description for a particular subject from a corresponding school ( in the subject_description Table).
Could this be done?
This is what I have written. I cant get it to work. Can someone please help? Is there a simpler way to do this? If there is then can someone please show me?
<cfif subject_description.Subject EQ form.Subject AND subject_description.SchoolID EQ selectsub_school.SchoolID >
<cfoutput>
<a href="subject_details.cfm?Subject_DescriptionID=#subject_description.Subject_DescriptionID#" >more info about the #subjectName(form.subject)# program at #School#</a></span></cfoutput>
<cfelse> no description avilable
</cfif>
many thanks..
Peter
There are 4 tables. schools, subjects, schools_subjects and subject_description
The relevant fields for these tables are as follows:
schools: School, SchoolID
schools_subjects: SchoolID, SubjectID
subject_description: Subject_descriptionID, SubjectID, SchoolID, Subject
I am trying to put something together to do this:
when someone SEARCHES for a school BY subject, it will give ALL the schools (link) that offer that particular Subject and also give the relevant subject_description (link). However it would also need to say ‘no description avilable’(linked to relevant school), IF there is no corresponding subject_description for a particular subject from a corresponding school ( in the subject_description Table).
Could this be done?
This is what I have written. I cant get it to work. Can someone please help? Is there a simpler way to do this? If there is then can someone please show me?
<cfif subject_description.Subject EQ form.Subject AND subject_description.SchoolID EQ selectsub_school.SchoolID >
<cfoutput>
<a href="subject_details.cfm?Subject_DescriptionID=#subject_description.Subject_DescriptionID#" >more info about the #subjectName(form.subject)# program at #School#</a></span></cfoutput>
<cfelse> no description avilable
</cfif>
many thanks..
Peter
