Re: [PHP-DB] Trying to add primary key to existing database.

2007-02-05 Thread OKi98
I think you also should read this http://en.wikipedia.org/wiki/Database_normalization -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Trying to add primary key to existing database.

2007-02-04 Thread Christopher Blöcker
hehe, ok i would write a script that reads the existing data from the table and inserts it into a new one that has the same structure PLUS a primary key something like: original_table:name, description, whatever new_table:id, name, description, whatever where id is primary key and

Re: [PHP-DB] Trying to add primary key to existing database.

2007-02-04 Thread Niel Archer
Hi. I don't know cPanel, but I expect it can run SQL directly, most panels can. Use the ALTER TABLE ADD {INDEX|KEY} syntax to add indexes/primary keys. You can use multiple columns, which together form a unique value to create your primary key. Niel -- PHP Database Mailing List

Re: [PHP-DB] Trying to add primary key to existing database.

2007-02-04 Thread Chris
Chris Carter wrote: Hi, I have a database, which was till now, not having any primary key defined. I thought I would not need it but now I think I do (based on the suggestions from my prior postings). I am now trying to insert the primary key in an already existing database. There was not even

Re: [PHP-DB] Trying to add primary key to existing database.

2007-02-04 Thread Chris
Christopher Blöcker wrote: hehe, ok i would write a script that reads the existing data from the table and inserts it into a new one that has the same structure PLUS a primary key something like: original_table:name, description, whatever new_table:id, name, description, whatever