how do you get the MySQL mysql_insert_id(); from within Rev?

Ken Ray kray at sonsothunder.com
Fri May 26 08:49:08 EDT 2006


--- Josh Mellicker <josh at dvcreators.net> wrote:

>> After you execute a revExecuteSQL INSERT, how do you
>> get the auto- 
>> incremented record ID MySQL automatically assigned
>> (from within Rev)?

You can use revDataFromQuery right after you have done your insert with
revExecuteSQL:

   get revDataFromQuery("","",tDBRef,"SELECT LAST_INSERT_ID()")

You may also be able to use *another* call to revExecuteSQL to run the same
SQL statement ("SELECT LAST_INSERT_ID()"), but I've only used
revDataFromQuery.

Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com




More information about the use-livecode mailing list