Re: Generate Receipt Number
| From: | - Edwin - | Date: | Wed, 01 Oct 2003 07:33:50 +0000 |
| Subject: | Re: Generate Receipt Number | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164495@lists.php.net to get a copy of this message | ||
Hi,
Just to add...
Larry E. Ullman <LarryUllman@DMCInsights.Com> wrote:
> > I am doing a receipt system whereby it can auto generate a
> > unique receipt
> > number for each receipt. It will be an increment of number
> > eg.000001, 000002,
> > 000003, and so on.....Wonder how should I go about doing this
> > using PHP? Do need
> > some help here..technologies used are:PHP and MySQL...
>
> Since you're using MySQL, create a table for your receipts with a
> receipt_number which is an auto_incremented, primary key, unsigned,
> not null, integer. When you add records to this, set this column's
> value to NULL or 0 and it will automatically use the next sequential
> number.
...and maybe "zerofill" will be useful here as well...
> See the MySQL manual for more.
(To the OP -> ) This is a good habit to acquire... ;)
- E -
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/