[UPHPU] Sequentially number records with php/mysql

Ashley Oviatt ashovi at qwest.net
Wed Nov 10 11:33:55 MST 2004


Yeah, I already have it doing that, I was just wondering if there was a
way without the db to do it. This looks like the best way though.

Ash


Brent Wilkinson wrote:

> Autoincrement is the way to go
> 
> Sample line
> 
> alter table <table> add <column> int(11) not null auto_increment, add
> primary key (<column>); 
> 
> 
> Brent Wilkinson
> Tech Manager
> Air2Data
> (866)-779-8585
> (801)-510-7474
> 
> -----Original Message-----
> From: uphpu-bounces at uphpu.org [mailto:uphpu-bounces at uphpu.org] On Behalf Of
> Wade Preston Shearer
> Sent: Wednesday, November 10, 2004 10:54 AM
> To: uphpu at uphpu.org
> Subject: Re: [UPHPU] Sequentially number records with php/mysql
> 
> 
>>I'm setting up a way for people to order business cards from our 
>>company.
>>
>>I have it all finished, but right now I'm just using random #'s to 
>>give them a job#. What's the easiest way to give them a sequential job 
>>number? I don't want a database full of unfulfilled orders, but I'm 
>>guessing that making a record in the db for each new customer is the 
>>way to go, and then delete the record if the person doesn't order, 
>>right?
>>
>>Anyway, just wanted to knwo what you guys thought.
> 
> 
> You can have the database automatically increment and assign a unique ID to
> each new record.
> 
> For example, in MySQL, you can set a column to do this with something
> like...
> 
> 	pid int unsigned auto_increment primary key,
> 
> 
> 
> 
> 
> _______________________________________________
> 
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
> 
> Sponsored by hostinginferno.com!
> 
> 






More information about the UPHPU mailing list