Connecting Tech Pros Worldwide Help | Site Map

mysql question

  #1  
Old December 23rd, 2005, 07:55 AM
lawrence k
Guest
 
Posts: n/a
If I write an update script, so people can upgrade their software to
the newest version I've written, and since the last version I've
created a new table in the database, so I want to add it, if it does
not already exist, is the syntax something like

create table if not exists subscribers

???

  #2  
Old December 23rd, 2005, 08:05 AM
Kimmo Laine
Guest
 
Posts: n/a

re: mysql question


"lawrence k" <lkrubner@geocities.com> wrote in message
news:1135323786.086492.272160@o13g2000cwo.googlegr oups.com...[color=blue]
> If I write an update script, so people can upgrade their software to
> the newest version I've written, and since the last version I've
> created a new table in the database, so I want to add it, if it does
> not already exist, is the syntax something like
>
> create table if not exists subscribers
>[/color]

Exactly like that.
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name
[(create_definition,...)]
[table_options] [select_statement]

http://dev.mysql.com/doc/refman/5.0/...ate-table.html

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
antaatulla.sikanautaa@gmail.com.NOSPAM.invalid


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql-question ojorus answers 6 August 4th, 2006 02:35 PM
Can't connect to local MySQL question Bill Hernandez answers 0 July 20th, 2005 12:04 AM
Can't connect to local MySQL question Bill Hernandez answers 0 July 20th, 2005 12:04 AM
PHP MySQL question Maziar Aflatoun answers 7 July 17th, 2005 02:14 PM
php/mysql question Chris Dean answers 3 July 17th, 2005 12:06 AM