-1

I am using MySql with classic asp. And i am inserting data in MySql Database.

I am Using this code to return ID when data is inserted. But it returns 0. so, is there any solution for return ID from MySql Database ?

Insert into table(name,lastname,username) Output Inserted.ID values("abc","def","ghi")

this returns value 0. So, how can i get ?

user692942
  • 16,398
  • 7
  • 76
  • 175
Nikunj
  • 307
  • 3
  • 12

1 Answers1

1

Use mysql_insert_id() function.

user692942
  • 16,398
  • 7
  • 76
  • 175
शेखर
  • 17,412
  • 13
  • 61
  • 117