![]() |
|
|
|
|
|||||||
| PHP / MySQL Assistance We understand. Not all of you are experienced programmers, but some of you are highly skilled at coding. So we've set aside this forum so you can ask questions, and provide answers to the most commonly asked PHP / MySQL issues. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
For some reason I need to add one more field in my DB. I have a shell access, a MySQL, only not know what exactly is the command in MySQL mode, because I am not skilled in MySQL.
Best Regards |
|
#2
|
||||
|
||||
|
If you want to add each time one field in a table, use the following command:
Code:
mysql> alter table tablename add column columname char(10); After commit the command line will dee notification lines: Code:
Query OK, 1 row affected (0.04 sec) Records: 1 Duplicates: 0 Warnings: 0 |
|
#3
|
|||
|
|||
|
My table consists of several fields. How to add all their fields at time? After all this I want to be sure that everything is OK.
|
|
#4
|
||||
|
||||
|
Anytime you can see the contents of your table. In mysql command line type:
Code:
select * from yourtable; Code:
alter table tablename add column columname1 datatype,add column columname2 datatype,add column columname3 datatype, add column columname4 datatype; Code:
TINYINT; SMALLINT; MEDIUMINT; INT; BIGINT; FLOAT; DOUBLE; DECIMAL; NUMERIC; DATE; DATETIME; TIMESTAMP; TIME; YEAR; CHAR; VARCHAR; TINYBLOB; TINYTEXTM; BLOB; TEXT; MEDIUMBLOB; MEDIUMTEXT; LONGBLOB; LONGTEXT |
![]() |
| Tags |
| adding, field |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|