Hi there!
If any of you have tried the following with ASP/ADO and MySQL, please inform
me of how you did it:
I use ASP and adodb.recordset to connect to a MySQL-database.
I use the following code to insert into the db:
[CODE START]
set rsGroup = server.CreateObject("adodb.recordset")
sql = "tblGroup"
rsGruppe.Open sql, connect
with rsGroup
.AddNew
.Fields("group_name") = strGName
.Fields("group_slogan") = strGSlogan
.Update
end with
[CODE END]
Now - the thing I have to do in the next line is, to get the (auto
incremented, indexed and unique) group_id of the newly inserted group from
tblGroup.
How do I do that? Can I call the last_insert_id() function in MySQL through
the recordset in some way? Or any other suggestions?
When I used Access-databases instead of MySQL, I could just call
rsGroup("group_id") in the next line of code, which would return the correct
group_id.
Please help, anybody!?
Kind regards,
Henrik Mohr, Denmark
w e b d a t a . d k
..................................
[EMAIL PROTECTED]
mob: +45 26 24 26 27
store kongensgade 36, 5.
postbox 9038
dk-1264 københavn k
tel. +45 70 20 11 60
fax. +45 70 20 11 61
http://webdata.dk
mail:[EMAIL PROTECTED]
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php