Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding multiple fields in one query

Status
Not open for further replies.

cabernet

Technical User
Feb 24, 2003
75
PK
I cannot figure the correct syntax to add many fields in an existing table; in one shot

from PHP MyAdmin

alter table xxxx add foo varchar 50 not null, foo_2 text not null; etc....

thanks

regards
 
thanks much for the correct syntax

I went before posting to the "MySQL alter table"
it does not mention anything about alter table

hmmm, I ewar glasses did read it twice; where is it?
 
I don't understand your question.

But if the gist of your question was, "How did you find that information in the MySQL online manual?", then the answer is that I went to and entered "alter table" in the manual lookup entry field on the left-hand side of the screen.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Yes Cabernet, you glasses must have been steamed up at the time ...... see:



This part:

alter_specification:
ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
| ADD [COLUMN] (create_definition, create_definition,...)
| ADD INDEX [index_name] (index_col_name,...)
| ADD PRIMARY KEY (index_col_name,..............

Where (create_definition = foo_varchar(10) not null, create_definition = bar_int, ........)

Laurie.
 
Sorry:

Where (create_definition = foo varchar(10) not null, create_definition = bar int, ........)


!:¬o

L.
 
Hello Laurie

thanks
I figured I was wearing sun glasses :)

Henry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top