Solved

updating the database

Posted on 2000-05-02
2
139 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

690 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