2012-04-29, 06:48 AM
Hi guys.
I'd like to retrieve the last thread's ID that was created (for use in a plugin).
I'm current hooking into newthread_do_newthread_end and trying to use the function mysql_insert_id() to get the last ID inserted, but there must be a few other queries that are run before the hook is actually run, so I can't do it.
I'd prefer not to use the datahander hook (for my own reasons) but I will if there's no other way.
I'd also prefer not to use another query to simply find the last record in the threads table. I want to minimise queries.
Thanks
I'd like to retrieve the last thread's ID that was created (for use in a plugin).
I'm current hooking into newthread_do_newthread_end and trying to use the function mysql_insert_id() to get the last ID inserted, but there must be a few other queries that are run before the hook is actually run, so I can't do it.
I'd prefer not to use the datahander hook (for my own reasons) but I will if there's no other way.
I'd also prefer not to use another query to simply find the last record in the threads table. I want to minimise queries.
Thanks