RunRev crashes when you experiment with database queries

Bill bill at
Fri Mar 18 09:58:57 EST 2005

I am trying to get the ID number of the last inserted record in a MySQL
database. Can anyone help me do this?

I tried:

put revConnectionOfQuery("ConnectCrew") into tConnection
  -- first escape error
  if tConnection is not a number then
    put "tConnection is:" && dbCUR into fld "Exec result"
    exit mouseUp
  end if

  put "SELECT LAST_INSERT_ID() from tripulantes" into dbQuery
  put revQueryDatabase(tConnection, dbQuery) into LastInsertID

I am trying the above because I need the ID of the last inserted row of data
in the table "tripulantes". The above does not give me the last ID instead
it gives a number like "59" when the ID would be 1289 or similar. If you run
it again, without making any changes in the database "LastInsertID" will be
60 then 61 and so forth. I don't know what it is doing but it is not what I
am looking for.

            |    |    |
           )_)  )_)  )_)
-------\                   /---------
 ^^^^^ ^^^^^^^^^^^^^^^^^^^^^
  ^^^^      ^^^^     ^^^    ^^
       ^^^^      ^^^

24 hour cell: (787) 378-6190
fax: (787) 809-8426

Blue Water Maritime
P.O. Box 91
Puerto Real, PR 00740

More information about the Use-livecode mailing list