Hi All
I am using CF5 and msaccess97 the server sits on a Windows 2000 platform.
When using the following code the database inserts two identical records
(all but the uniquieid) I have used debug and the insert stament in not
looping - it's driving me insane. I have heard this may be a bug? Dose
anyone else know?
Regards
Jason
<!-----// set todays date------->
<cfparam name="ldate" default="#DateFormat(now(),"dd-mmm-yyyy")#">
<!---//lock the code to retreive the last entered id------->
<cflock name="insertinto" type="exclusive" timeout="30">
<!----//check to see how many lists are already saved for this user, and
redirect them if
they have more than six//---->
<cfquery name="getlist" datasource="#application.dsn#">
SELECT *
FROM
save_list
where luserid = #session.id#
</cfquery>
<cfif getlist.recordcount LT 6>
<!-----//if the user has less than six saved lists, save the new
list//-------->
<cfquery name="insert" datasource="#application.dsn#">
INSERT INTO save_list (ldate, lname, list, luserid)
VALUES ('#ldate#', '#lname#', '#selected#', #session.id#)
</cfquery>
<!-----//get that last saved list id for the re-direct//------>
<cfquery name="getmax" datasource="#application.dsn#">
SELECT max(listid) as id
FROM save_list
</cfquery>
<!------//now the list is saved delete the temporary search list//---->
<cfquery name="delete" datasource="#application.dsn#">
DELETE FROM searchlist
where userlink = #session.id#
</cfquery>
<!----now re-direct the user to saved list//------>
<cfoutput>
<script language="JavaScript">
setTimeout(window.location ='saved_results.cfm?id=#getmax.id#', 5000);
</script>
</cfoutput>
<!------//if the user already has six saved lists, re-direct them and ask
them to overwrite one of the existing---->
<cfelse>
<cflocation
url="over_ten.cfm?selected=#selected#&urlname=#form.lname#&ldate=#ldate#">
</cfif>
</cflock>
This e-mail and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
[EMAIL PROTECTED]
Whilst every endeavour is taken to ensure that e-mails are free from
viruses, no liability can be accepted and the recipient is requested
to use their own virus checking software.
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists