Web Design Forums

Welcome! Please register or log in: Forgot your password? Why register?
You are here: Web Design Forums » Programming Help » PHP » Need modifications to an existing table RSS

Need modifications to an existing table

This thread was started by asdfghjkl and has been viewed 369 times, and contains 2 replies, with the last reply made by asdfghjkl.
Post Reply
1
View asdfghjkl's reputation
Posted January 19 '10 at 11:18 AM
      Posts: 4
Hi everyone. I'm very new to mysql and php, learning as I go. Working on a database which has a problematic design oversight. The primary key is a combination of two fields, on the assumption that these fields would never be the same, but that is not the case as I find the need to create multiple records with identical values in these fields

So I want to alter this table, to add a new AUTO INCREMENT column, and change the primary key to that. The table currently has just under 10,000 records in it which are valuable, so I can't afford to mess this up. Can anyone advise as to what I should do? I'd assume the ALTER query will be needed.

Thank you in advance for replies

Advertisement Register for free to hide these ads and participate in discussions!

2
1,251 points at 99% Moderator Repute
mlseim, WDF Moderator Private message  
Posted January 19 '10 at 03:17 PM
      Posts: 3,100
Do you have access to the MySQL admin control panel?

With that, you can make a safe backup to begin with ...
then add the new column with the variable parameters you want.
It will automatically number them all in order ... unique numbers.
If it's zero degrees outside today, and it's supposed to be twice as cold tomorrow, how cold is it going to be?

3
View asdfghjkl's reputation
Posted January 19 '10 at 10:24 PM
      Posts: 4
Thanks Mr. Mlseim. Very good your advise, may be its useful for me.

Post Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE and Myspace Css Issues :( pleaseee help Gabriella HTML and CSS Help 5 October 31 '09 04:05 PM
ugh please help me, myspace layout css div overlay comments messup CSM Pickard HTML and CSS Help 4 July 14 '09 11:23 PM
Need someone who is great at Firexo/IE CSS discrepency issues... kennedrw HTML and CSS Help 1 November 14 '07 02:21 AM
My funky shoe database, part 2 TheGardener PHP 4 October 17 '07 12:24 AM
adding a row into an existing table kdog316 PHP 6 May 8 '03 04:49 PM