MySQL doesn't allow multiple statements in a single query unless you change a server config option. It's a form of SQL injection protection. So just run the two statements in two CFQUERY tags. You'll need to ensure they're on the same connection with no interleaved queries though, so make sure you use CFTRANSACTION if, for some reason, you're not already.
cheers, barneyb On Wed, Jan 14, 2009 at 10:48 AM, Will Tomlinson <w...@wtomlinson.com> wrote: > I don't want to use the new result variable in CF8 here. What's the right > syntax for getting the last inserted ID in mySQL. I'm getting a syntax error > with this: > > insert into sometable (fields...) > values (values....) > ; > select last_insert_id() as lastinsert > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317950 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4