Skip to main content
Participant
March 2, 2007
Question

Primary Key? How to auto generate for regsitration?

  • March 2, 2007
  • 4 replies
  • 322 views
I'm using DW8, i'm creating a registration form and I placed a hidden field in it called res_id. I want this to auto generate a unique id when people register.. how is this possible?
This topic has been closed for replies.

4 replies

Known Participant
March 2, 2007
Paul is right with that,

If you open up your MySQL Command line client and alter the table with a statement like:

ALTER TABLE myTable
ADD PRIMARY KEY (columnName);

Where myTable and columnName are the name of the table and column you want to edit.

That should at least set the column to the primary key.

If you want to set the primary key to auto generate a unique id follow this up with another command like:

ALTER TABLE myTable
MODIFY columnName int auto_increment;

Use the command:

describe myTable;

to see the structure of the table and to check that everything has worked ok...

Hope this helps.

Hugh.
Inspiring
March 2, 2007
Generally you would generate the key in the database and then call it back
to subsequent pages if you needed it.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"nwatkin03" <webforumsuser@macromedia.com> wrote in message
news:es7r30$ltc$1@forums.macromedia.com...
> I'm using DW8, i'm creating a registration form and I placed a hidden
> field in it called res_id. I want this to auto generate a unique id when
> people register.. how is this possible?


nwatkin03Author
Participant
March 2, 2007
mysql with php
Inspiring
March 2, 2007
What database are you using?
Dave
"nwatkin03" <webforumsuser@macromedia.com> wrote in message
news:es7r30$ltc$1@forums.macromedia.com...
> I'm using DW8, i'm creating a registration form and I placed a hidden
field in it called res_id. I want this to auto generate a unique id when
people register.. how is this possible?