You are here: mysql autoincrement- return id « PHP Language « IT news, forums, messages
mysql autoincrement- return id

Posted by <talthen.z-serwera.o2 on 08/28/05 18:06

Hello,
I have a table with column ID of auto increment type.
I want to insert a record in the table and then I want to show it's ID.
My best idea is to count the records in the table after inserting the
record.
But if 2 people will insert different records in the same time in the same
table, then
it is possible that they will get wrong ids.
To be sure that the script will always return right id I can write a sql
query that will search the table for record of values same as the ones, that
have been just saved.

But- can I do it easier and faster?

Regards,
Talthen

 

Navigation:

[Reply to this 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

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