You are here: running number « PHP « IT news, forums, messages
running number

Posted by Roger Thomas on 07/25/05 12:21

I am required to write a user registration script that captures the basics like name, phone number etc etc. I would also have to write to mySQL database a number that is associated with that user.

At this point of writing, the start of that number is unknown. But the number will be incremented by 1 after each successfull registration.

Let's say the number starts from 12345.

I am quite new at all these stuff and would like to seek your advise on the *recommended way* of achieving this. I am thinking along these lines:
a) store that number (12345) in a table
b) a user registers and assign that number to him
c) increment number to 12346
d) process repeats for the next registration

Concern: How do tell mySQL to lock the 'number' table when a new registration process is about to take place. Is locking the best option here or is/are there better ways?

Please advise.

--
Roger


---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------

 

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

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