Web Analytics Made Easy -
StatCounter MySQL-LabView8.0 select last_insert_id - CodingForum

Announcement

Collapse
No announcement yet.

MySQL-LabView8.0 select last_insert_id

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL-LabView8.0 select last_insert_id

    Hello,
    I'm making a measuring program based on LabView 8.0, the results of measurements are saved into MySQL database.

    The problem is when I'm inserting datas into MySQL I want to know into which line the measurement is been saved. So I used the LAST_INSERT_ID, but all what I'm getting back is 0.

    When I tried this in MySQLCC this worked just fine.

    Thank you

    Rok

  • #2
    you can only use last_insert_id when you are inserting into a table that has an auto increment field. without it you won't. the secondary table does not have to have an auto increment column.

    Comment


    • #3
      ups...
      I forgot to tell, yes I haave an auto increment field. And tnd Insert_last_id(), the problem is because i can't get that ID into LabView.

      ( I have a few inserts and selects between MySQL and LV, but this is the only one which is making a problem)

      Comment


      • #4
        if you do any inserts in between the one with the table with the auto increment and the one where you are using that variable then set it in a variable.

        See this article for more info on using last_insert_id.

        Comment

        Working...
        X