Databases :: MySql :: why LAST_INSERT_ID() returns 0 delphi |
|||
| By: Nono |
Date: 11/04/2008 21:20:40 |
Points: 20 | Status: Answered Quality : Excellent |
| why LAST_INSERT_ID() returns 0 in delphi ? | |||
| By: VGR | Date: 11/04/2008 21:23:59 | Type : Answer |
|
| Well, I use Delphi too but I never found the various client library solutions to be ***that*** handy. Moreover, I prefer to code exclusively in PHP, included for console "DOS" applications (CLI) In your case, expanding on This PAQ, I would recommend either : - you call mysql_last_insert_id() in your API - you query back using a discriminant ( a unique value you're pretty sure will return the exact same line which was inserted) and get the id - (less reliable) you do the classical : select id from yourtable order by id desc limit 1; regards |
|||
|
Do register to be able to answer |
|||
| Add This Article To: | |||
| |
|
|
|
| |
|
|
|









