Hey Everyone,
Well i been trying my best to understand how to update existing records using the url method. I understand most of it except what i am trying to do.
I have a 2 page form. The first page only uses 1 table and the second page uses 3 different tables. I understood how to get the first page, but i am baffled by how to do the second page of my form.
Here is what i have
this is the index page where you choose what record you want updated and will take
you to the first page of the form.
CODE
<cfquery name="ticket" datasource="CustomerSupport">
SELECT pk_ticketID,status,title,date_last_modified,date_submitted,customer_company FROM dbo.tbl_CS_ticketMaster
</cfquery>
<cfoutput query="ticket">
<a href="form/cticketpage1edit.cfm?pk_ticketID=#pk_ticketID#" target="_blank">#pk_ticketID#</a>
</cfoutput>
that part i understand. its the part where i go to the second page i can not get.Basically i am trying to get the same information for all 3 tables. In each table i created a field that will have the same number. For example
in the ticket table it has the field pk_ticketID. The serial table has the field pkb_fk_ticketNo and the parts table has fk_ticketNo. When i insert a record all 3 of those fields will have the same number for example 1.Any who its retrieving the correct information for all 3 tables that has me confused.The way i have been trying
gets the correct information for the ticket table but for the serial an parts it still gets every record in that table instead of getting the one associated with the ticket table field. For example if the ticket table's number is 1, then the serial and parts information should both be 1. but right now it gets 1 an any other records in those tables.
here is what i have been trying, this is on the first page of the form
CODE
<cfquery name="ticket" datasource="CustomerSupport">
SELECT pk_ticketID,title,priority,status,cost_center,fk_customer_number,
& nbsp;customer_company,customer_Fname,customer_Lname,customer_add1,customer_city,
customer_state,
& nbsp;customer_zip,customer_email,customer_pri_phone,customer_sec_phone,customer_
notes,htpp FROM dbo.tbl_CS_ticketMaster
WHERE pk_ticketID = #URL.pk_ticketID#
</cfquery>
<cfquery name="serial" datasource="CustomerSupport">
SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,
resolution_date,
verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_
verified_by FROM dbo.tbl_CS_serial
</cfquery>
<cfquery name="parts" datasource="CustomerSupport">
SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned,defective,submission
FROM dbo.tbl_CS_parts
</cfquery>
<form name="page1" id="page1" action="saveticket1edit.cfm?<cfoutput query="ticket">pk_ticketID=#pk_ticketID#</cfoutput><cfoutput query="serial">&pkb_fk_ticketNo=#pkb_fk_ticketNo#</cfoutput><cfoutput query="parts">&fk_ticketNo=#fk_ticketNo#</cfoutput>"
method="POST" onSubmit="return validate_form();">
<cfoutput query="ticket">
<input type="hidden" name="pk_ticketID" id="pk_ticketID" value="#pk_ticketID#" />
</cfoutput>
<input type="submit" value="Submit" class="officalsubmit"/>
</form>
this is the second page of the form
CODE
<cfquery name="ticket" datasource="CustomerSupport">
SELECT pk_ticketID,title,priority,status,cost_center,followup_date,fk_customer_number,
& nbsp;customer_company,customer_Fname,customer_Lname,customer_add1,customer_city,
customer_state,
& nbsp;customer_zip,customer_email,customer_pri_phone,customer_sec_phone,customer_
notes,onsite_flag,number_onsite,htpp FROM
dbo.tbl_CS_ticketMaster
WHERE pk_ticketID = #URL.pk_ticketID#
</cfquery>
<cfquery name="serial" datasource="CustomerSupport">
SELECT pka_serialNo,pkb_fk_ticketNo,model_no,product_type,software_hardware,resolution,
resolution_date,
verification_date,rma_data,type_hardware_failure,dept_responsibility,resolution_
verified_by FROM dbo.tbl_CS_serial
</cfquery>
<cfquery name="parts" datasource="CustomerSupport">
SELECT pk_partID,fk_serialNo,fk_ticketNo,hc_partNo,part_returned,defective,submission
FROM dbo.tbl_CS_parts
</cfquery>
<form>
<cfoutput query="ticket">
<input type="hidden" name="pk_ticketID" id="pk_ticketID" value="#pk_ticketID#" />
</cfoutput>
<cfoutput query="serial">
<input type="hidden" name="pkb_fk_ticketNo" id="pkb_fk_ticketNo" value="#pkb_fk_ticketNo#"/>
</cfoutput>
<cfoutput query="parts">
<input type="hidden" name="fk_ticketNo" id="fk_ticketNo" value="#fk_ticketNo#" />
</cfoutput>
</form>
if someone could please explain what i am doing wrong an how to fix it i would very much appreciated it because i am lost.
Thank you in advance,
Rach
This post has been edited by bonneylake: 17 Sep, 2008 - 07:12 AM