Re: running number
| From: | Richard Davey | Date: | Mon, 25 Jul 2005 10:28:41 +0000 |
| Subject: | Re: running number | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-219295@lists.php.net to get a copy of this message | ||
Hello Roger,
Monday, July 25, 2005, 10:21:54 AM, you wrote:
RT> I am quite new at all these stuff and would like to seek your
RT> advise on the *recommended way* of achieving this. I am thinking
RT> along these lines:
RT> a) store that number (12345) in a table
RT> b) a user registers and assign that number to him
RT> c) increment number to 12346
RT> d) process repeats for the next registration
RT> Concern: How do tell mySQL to lock the 'number' table when a
RT> new registration process is about to take place. Is locking the
RT> best option here or is/are there better ways?
Do you HAVE to have a "starting off" number of 12345? If there is no
real reason to do this, then use an auto-increment column in MySQL and
let that do all the hard work for you!
Best regards,
Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov