Hi guys,
I'm trying to find out what the last record number was that I inserted
but am coming up with some errors. I first have inserted the fields and
then I am calling another query to select the max row. Can anybody shed
any light on this.
<cfquery name="InsertNewProperty" datasource="MyTotalHouses">
insert into properties (propertyfirstname, propertylastname,
propertytype, propertytitle, propertynumberofbedrooms, propertytown,
propertystate, propertycountry, propertyowneremailaddress,
propertyprice, propertypriceperiod, propertypricecurrency,
randomconfirmationnumber)
values ('#form.propertyfirstname#', '#form.propertylastname#',
'#form.propertytype#', '#form.propertytitle#',
'#form.propertynumberofbedrooms#', '#form.propertytown#',
'#form.propertystate#', '#form.propertycountry#',
'#form.propertyowneremailaddress#', '#form.propertyprice#',
'#form.propertypriceperiod#', '#form.propertypricecurrency#',
'#randomconfirmationnumber#')
</cfquery>
<cfquery datasource="MyTotalhouses" name="GetID">
SELECT MAX(ID) AS ThisID
FROM Properties
</cfquery>
<cfoutput>Last record number inserted: #GetID.ThisID#</cfoutput>
Thanks very much.
Stu
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/