[ic] SQL query
Jon Jensen
interchange-users@icdevgroup.org
Wed Mar 26 14:46:01 2003
On Wed, 26 Mar 2003, Michael wrote:
> Is it possable to have more than one sql statement in a [query] tag?
That depends on your DBD driver.
> I have a table I am inserting data into where the key is defined as
> auto_increment. After that insert, I wanted to use the MySql
> last_insert_id() function to grab the abovementioned key value for
> use elsewhere. The MySql last_insert_id() fcn is valid on a per connection
> basis, and I am assuming (danger!) that the [query ...] ... [/query]
> container pair opens the connection, does its thing, then closes the
> connection.
The [query] tag does not initiate a new connection, if one was already
open. AFAIK only fiddling with the [flag type=transaction] on a table
handle will cause a disconnect and reconnect.
Why don't you just give it a try and see if it works? :)
Jon