Connecting Tech Pros Worldwide Help | Site Map

mysql question

 
LinkBack Thread Tools Search this Thread
  #1  
Old December 23rd, 2005, 06:55 AM
lawrence k
Guest
 
Posts: n/a
Default mysql question

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, 07:05 AM
Kimmo Laine
Guest
 
Posts: n/a
Default 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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.