* oe-ander
> How do i check if a column(name) do not exists in a table before i add it?
> Like: alter table fruit add aple varchar(20) not null if aple do not
exists

As far as I can see, you have two options:

- Do a "describe fruit", and check the "Field" column
- Do the "alter table...", and check for a error msg

The second method is probably best, because you can not be sure if someone
have added the column after you do a "describe fruit", but before you do
your "alter table...".

--
Roger
query


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to