Solved

updating the database

Posted on 2000-05-02
2
133 Views
Last Modified: 2013-12-24
I am creating a page where I give users the abilty to enter a resume in the database and also the ability to come back and edit it. The problem I am having is that I am using an insert statement then an update statement. If I use only an insert then it will insert the record a number of times, once for everytime they fill out their resume. The update statement will work but only if I enter their id (parid) into the database first. How can i set it up so that when they fill out the form for their first time it will enter the id into the database, and then after that it will simply update the info...here is what I have now.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<cfoutput>#parid#</cfoutput>
<html>
<head>
      <title>Untitled</title>
</head>

<cfquery datasource="#ODBC_Datasource#" name="insert">
Insert into Resume(
                  ParId)
                  
            Values(
                  #parid#)
                  
                        
</cfquery>


<CFQUERY datasource="#ODBC_Datasource#" name="Update_Resume">
            Update resume
                  
            Set      
                Parid=#parid#,
                Resume1='#form.resume1#',
                  Resume2='#form.resume2#',
                  Resume3='#form.resume3#',
                  Resume4='#form.resume4#',
                  Resume5='#form.resume5#',
                  Resume6='#form.resume6#',
                  Resume7='#form.resume7#',
                  Resume8='#form.resume8#',
                  Resume9='#form.resume9#',
                  Resume10='#form.resume10#'
                  
            Where ParID = #ParID#
            
            </CFQUERY>
<body>

<CFLOCATION url="who.cfm">

</body>
</html>
0
Comment
Question by:the_kid
2 Comments
 

Accepted Solution

by:
bhakthan earned 10 total points
ID: 2769839
Use session id as the parid. So you can use the same id for inserting and updating the table. Or create a cookie with parid and use the cookie for updating.
0
 

Author Comment

by:the_kid
ID: 2792433
Thanks for your help...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now