Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Primary Key? How to auto generate for regsitration?

New Here ,
Mar 01, 2007 Mar 01, 2007

Copy link to clipboard

Copied

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?
TOPICS
Server side applications

Views

299
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 01, 2007 Mar 01, 2007

Copy link to clipboard

Copied

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?


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 01, 2007 Mar 01, 2007

Copy link to clipboard

Copied

mysql with php

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2007 Mar 02, 2007

Copy link to clipboard

Copied

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?


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 02, 2007 Mar 02, 2007

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines