how can I create automatic code for visitors in mySQL?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
prasitc2005
Forum Commoner
Posts: 42
Joined: Thu Jul 13, 2006 7:14 am

how can I create automatic code for visitors in mySQL?

Post by prasitc2005 »

Hi all MySQL gurus

I have a MySQL table with column name called registration code.

How can I use php script to automaticly create 8-digit unique registration numbers for each visitor name and e-mail address. They won't repeat themseves and not in obvious order like 12345678

column names are

id name e-mail address password registration code

1 yan yan&gmail.com 1234 72145320
2 top top@yahoo.com xvbt 88653421

Thanks!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You were given a function by litebearer.. it could be used here too.
User avatar
prasitc2005
Forum Commoner
Posts: 42
Joined: Thu Jul 13, 2006 7:14 am

Post by prasitc2005 »

No, it's a different case this time. I need to know how to do it inside mysql phpmyadmin this time. Just want to do it with sql command like update table something...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

No, it's actually not all that different this time.
Post Reply