SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm very much a newbie to MySQL and haven't been able to successfully install it on my W2K machine yet so I have now way of testing this syntax. At any rate, I am helping a friend who has very little database experiance, but is working in MySQL. Am I on the right track?


    create table churches (
    church_ID int not null auto_increment,
    primary key(church_ID),
    index(index_church_ID),
    church_name varchar(23) not null,
    church_address varchar(18) not null,
    church_city varchar(13) not null,
    church_state varchar(2) not null,
    church_zip varchar(5) not null,
    church_phone varchar(12) not null,
    church_fax varchar(12),
    church_email varchar(13),
    church_contact varchar(13)
    );


    create table users (
    user_ID int not null auto_increment,
    primary key(user_ID),
    index(index_user_ID),
    church_ID foreign key(index_church_ID),
    more data....
    );
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  2. #2
    SitePoint Addict Percipient's Avatar
    Join Date
    Jun 2000
    Location
    Summerland, BC, Canada.
    Posts
    226
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looks fine except for when defining an index, just use "index(column_name)", without "index_" in front of the column name. I tested it (by creating one of your tables on my machine), and, as long as I leave out the "index_", it creates a new table just fine.
    Last edited by Percipient; May 6, 2001 at 22:14.
    Ed Rands

  3. #3
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •