Currently we have 1 person updating staff profiles from our company. Recently they asked me to add a new field titled: Global Public Health Experience. Basically I added the section and radio buttons indicating a Yes or No answer. Everything on that page is saved onto a MySQL database, which I respectively also created a new section for the new field.
Once I did everything and ran a test I realized it was reading the database fine but not updating it if the answer changed from Yes to No or vice-versa. I changed the answer in the database itself and it updated perfectly but when i try to update it via the form, event though I don't get any error messages, it doesn't apply the updates onto the database.
Here's everything I have.
First I run the SQL query that updates database (what you see in bold is the section for this new field):
<cfquery name="bioupdate" datasource="sph_Edit">
UPDATE tblpersonnel
SET tblPers_FirstName='#firstname#', tblPers_LastName='#lastname#', tblPers_MI='#MI#', tblPers_PositionTitle='#positiontitle#',
tblPers_ExpandedTitle='#ExpandedTitle#', tblPers_Building='#building#', tblPers_Room='#room#', tblPers_Tel='#phone#',
tblPers_Email='#email#', tblPers_Fax='#fax#', tblPers_ExtAddress='#alternateaddress#', tblPers_Campus_fk='#campus#',
tblPers_ResearchInterests='#researchinterests#',tb lPers_DegreesCerts='#degreescerts#',
tblPers_ProfessionalService='#professionalservice# ', tblPers_CommunityService='#communityservice#',
tblPers_PublicationsLinks='#publicationslinks#',
tblPers_ImageLocation='#ImageUploadFileName#', tblPers_CVLocation='#CVUploadFileName#',
tblPers_Credentials='#Credentials#', tblPers_Dept_fk='#department#', tblPers_unit_fk='#unit1#', tblPers_unit2_fk='#unit2#',
tblPers_unit3_fk='#unit3#', tblPers_unittitle='#unit1title#', tblPers_unit2title='#unit2title#',
tblPers_unit3title='#unit3title#', tblPers_Ethnicity_fk='#ethnicity#', tblPers_Gender='#gender#',
tblPers_TenureStatus='#tenurestatus#', tblPers_Effort='#effort#', tblPers_FacultyRank_ID_fk='#facultyrank#',
tblPers_AppointmentDate='#DateFormat(appointmentda te, "yyyy-mm-dd")#',
tblPers_AppointmentType_ID_fk='#appointmenttype#', tblPers_Type='#type#', tblPers_PrimAfil='#primaryaffiliation#',
tblPers_gphe='#gphe#'
WHERE tblPers_ID_pk='#URL.tblPers_ID_pk#'
</cfquery>
Then I have a query reading the database (the bold is for the new field):
<cfquery name="bio" datasource="sph_Read">
SELECT * from tblpersonnel WHERE tblPers_ID_pk='#URL.tblPers_ID_pk#'
</cfquery>
<!-- Set Paramaters -->
<cfset bioStruct=StructNew()>
<cfset bioStruct.gpheY="no" >
<cfset bioStruct.gpheN="no" >
Then I created conditions to select the correct answer on the form:
<cfif #bio.tblPers_gphe# EQ 'y'>
<cfset bioStruct.gpheY="yes">
<cfelse>
<cfset bioStruct.gpheN="yes">
</cfif>
Finally here's the field itself (nothing bold here, it's all for the new field):
<div class="inputtitlelong">Global Public Health Experience</div>
<div align="center" class="htmlinputlong2" id="gphexperience">
<cfinput name="gphe" type="radio" required="yes" message="Please indicate if this member has Global Public Health Experience" value="y" checked="#bioStruct.gpheY#" />Yes
<cfinput name="gphe" type="radio" value="n" checked="#bioStruct.gpheN#" />No
</div>
Please, if you notice something's wrong let me know. I've been struggling with this issue for some time now and still can't figure out what the heck is causing it not to work. Thanks for all your help in advance!