Reply to Re: returning autogenerated ID on new item

Your name:

Reply:


Posted by Hendri Kurniawan on 01/05/07 23:06

mysql_insert_id()
See the manual for any pitfalls

Hendri Kurniawan

toodi4 wrote:
> Lets say you have a form that when saved to the mysql database creates
> a unique incremental id. The form is just the first part of a series
> of things the user can do, so once the ID is created, the page would
> need to know immediately what this ID is. Is there a way to grab this
> ID instantly once it is created? Obviously if this were a sign-up for
> and a new user name and password are involved, you can have the user
> login after the initial set up and this select statement would bring
> back the ID. But the situation I have doesn't work like that.
>
> The way I have been dealing with this is simply to have a select
> statement after the initial insert that requests the record based on a
> couple of other fields that are likely unique. But this seems like a
> rather kludgy way of doing it. Is there some other solution.
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация