-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
  • 15,667
  • 7
  • 74
  • 164
Nikunj
  • 307
  • 3
  • 11

1 Answers1

1

Use mysql_insert_id() function.

user692942
  • 15,667
  • 7
  • 74
  • 164
शेखर
  • 17,236
  • 13
  • 56
  • 110