SQL table creation
#1

Hello!
I have a simple doubt about creating SQL table.

I had made a MySQL R6 script some months ago and now i would like to add some more fields in the table.
The problem is there are currently 5000+ users has registered and i don't want to loose those accounts.

So, is it possible to create more fields into the current database table?

Please try to respond as soon as possible..

Thank you.
Reply
#2

Yes, it is possible! For every users in your database, when you create more field, it will add default value 0, or what you set as default.
Reply
#3

Quote:
Originally Posted by WopsS
Посмотреть сообщение
Yes, it is possible! For every users in your database, when you create more field, it will add default value 0, or what you set as default.
Oh that would be good, but how may i create extra fields?
Reply
#4

ALTER TABLE table_name
ADD column_name datatype
Reply
#5

ALTER TABLE "TableName" ADD "newfiledname" int(10) NOT NULL DEFAULT '0';
without quotes
example :
ALTER TABLE Users ADD Money int(10) NOT NULL DEFAULT '0';

hope it works
Reply
#6

Thank you both, i couldn't give rep due to my past behavior
Reply
#7

phpmyadmin allows you to manage your databases much easier.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)