I think I did not explain clearly enough.
I did create a query like that in my code. My main problem is other thing.
For example, the person_skill table contain
personID 1 has skillID A
personID 1 has skillID B
personID 1 has skillID K
When that person loggin. I have to display check within the checkbox next to skill A, B and K. Also, I have to put checkbox next to other skills but with no check inside.
The purpose of that is to allow that person to update his skill. He can keep the skills by keeping the check within the checkbox. Otherwise, he can make check other skills that he wants to add in his record.
I try to use cfloop.
However, it display one checkbox with check and one without check next to skillA, B, K. This is not what I want. I just want it to have one checkbox with check inside next to those skill that person has.
here is the code that I used
<cfif #showperson_skill.skillID# EQ 'A'>
<cfinput type="checkbox" name="skillID" value="A" check="yes">
<cfif #showperson_skill.skillID# NEQ 'A'>
<cfinput type="checkbox" name="skillID" value="A">
Here is the query:
<cfquery name="showperson_skill" datasource="dsn">
select personid, skillid
where personid = #form.loggin_personid#
If anyone knows how to solve it, please let me know. Thanks.