I'd take a very close look at your database on your production server- make
sure that the pro_id column is set up exactly the same as on your
development server.

Since you're doing an update, not an insert, it shouldn't be creating a new
key value, even if the field is set as autonumber/identity. You could try
changing the order of your queries and see if it works then (looking up the
key value first, then update the record based on the key value pro_id).

HTH,
Eric

-----Original Message-----
From: Joby Bednar [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 26, 2001 2:41 PM
To: CF-Talk
Subject: urgent... query/variable problems...


I posted a question the other day asking about session variables and
password protected folders... I've narrowed the problem down to the
following (and it has nothing to do with folders and session variables):

I have a script that updates a database from info from forms and then
selects the id (key) and stores it in a session variable to be used in the
next couple stages later on.  The problem is that the second query doesn't
grab anything when I tested the site on our live server.  The odd thing is
that it works on my laptop but doesn't work on our live server.  There
doesn't seem to be anything wrong with session variables... all the other
variables created are stored fine.  The problems only seems to be the
variable "pro_id".

Here's the latest version of the code I've been trying to get to work:

<cfquery datasource="xxx">
 UPDATE Profiles
 SET  pro_business_type = '#form.pro_business_type#',
   pro_business_year = #form.pro_business_year#,
   pro_sic = '#form.pro_sic#',
   pro_business_ee = #form.pro_business_ee#,
   pro_business_revenue = '#form.pro_business_revenue#',
   pro_business_stock = #form.pro_business_stock#,
   pro_business_traded = #form.pro_business_traded#,
   pro_business_homebased = #form.pro_business_homebased#,
   pro_step = 4
 WHERE pro_session_id = '#session.pro_session_id#'
</cfquery>

<cfset session.pro_business_type = form.pro_business_type>
<cfset session.pro_business_year = form.pro_business_year>
<cfset session.pro_sic = form.pro_sic>
<cfset session.pro_business_ee = form.pro_business_ee>
<cfset session.pro_business_revenue = form.pro_business_revenue>
<cfset session.pro_business_stock = form.pro_business_stock>
<cfset session.pro_business_traded = form.pro_business_traded>
<cfset session.pro_business_homebased = form.pro_business_homebased>
<cfset session.guests = form.guests>
<cfset session.pro_step = 4>

<cfquery datasource="xxx" name="getproid" maxrows="1">
 SELECT pro_id
 FROM Profiles
 WHERE pro_session_id = '#session.pro_session_id#'
</cfquery>

<cfset session.pro_id = getproid.pro_id>

Is there some sort of timing issue that prevents the second query from
working right after updating the same DB?  How can I get around this?  Any
insight you might have would be very helpful!!!
Joby Bednar
Director of Internet Design
iNEOgroup.com
http://www.ineogroup.com
Fusing your Dreams and the Web, Together as One
[EMAIL PROTECTED]
Cell:  949-283-5138
Personal Fax:  208-485-1170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to