Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

updating the database

Posted on 2000-05-02
2
Medium Priority
?
142 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 30 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

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

715 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