...

View Full Version : Looking for Documentation



Socraties
10-29-2002, 07:19 PM
Hey all I am looking for some kind of documentation/tutorial. What I am looking for in this tutorial is examples how to create a script with some kind of if logic.

The reasoning for this is when I am writing small scripts for sql tables i want to create the database if it doesn't exist.

if anyone could send me in the right direction it would be great.
Thanks in advance.

Socraties
10-30-2002, 10:18 PM
well i figured this out. In case anyone else is curious on how to add if logic to a sql script you simply do this;

create database if not exists dbname;

create table if not exists tablename(tablevalues....);

Spookster
10-30-2002, 10:52 PM
it's all right there in the mysql documentation:

http://www.mysql.com/doc/en/CREATE_DATABASE.html

http://www.mysql.com/doc/en/CREATE_TABLE.html

Socraties
10-31-2002, 07:36 PM
hahaah yeah thanks, I just wasn't paying too much attention to the documentation, as well as I wasn't looking in the documentation in the right sections. But after hours of frustration I finally realized what was going on :) Thanks for the links though I know I will be there quite often :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum