Thread: Create table...

    #1
  1. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    15
    I am kind of new to MySQL. My question is, where do I put the Create Database and Create Table code???

    IE.

    CREATE TABLE posts (
    ID int(5) DEFAULT '0' NOT NULL auto_increment,
    TopicID int(5) DEFAULT '0' NOT NULL,
    Name varchar(50) NOT NULL,
    Email varchar(50) NOT NULL,
    Password varchar(50) NOT NULL,
    TimeStamp varchar(10) NOT NULL,
    Post text NOT NULL,
    PRIMARY KEY (ID)
    );

    CREATE TABLE topics (
    ID int(5) DEFAULT '0' NOT NULL auto_increment,
    TopicName varchar(50) NOT NULL,
    PRIMARY KEY (ID)
    );

    Do I type this in the page where the database is called?


    ------------------
    Hartmann
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    26
    Rep Power
    0
    Hello Hartman,

    Judging from the code you have written you have defined your database and 2 tables. The coded that you will generate when you input data and extract data from these tables can be placed any where eg. embedded into html files etc. Read some articles on this website - thats how I have been learning. Good luck!

    Richard
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    26
    Rep Power
    0
    Sorry reading your post again has shed your angle. Table data is stored on your server that has PHP and Mysql installed. I use a PHP administration software that allows me to update tables etc.

    Richard
  6. #4
  7. chown python:users\ /world
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Texas Tech
    Posts
    95
    Rep Power
    15
    Let me clarify.....

    Would the code above be placed in a regular PHP file after created the Database?

Similar Threads

  1. create table error
    By breward in forum MySQL Help
    Replies: 2
    Last Post: October 16th, 2003, 02:24 PM
  2. Replies: 1
    Last Post: November 17th, 2002, 09:11 PM
  3. Look up MySQL table, create log report
    By RandyL712 in forum Perl Programming
    Replies: 1
    Last Post: November 13th, 2002, 08:16 AM
  4. create mysql table in php
    By jzimmer890 in forum PHP Development
    Replies: 1
    Last Post: July 12th, 2001, 10:01 AM
  5. create table for new user
    By johnhelen in forum PHP Development
    Replies: 1
    Last Post: June 2nd, 2001, 10:57 AM

IMN logo majestic logo threadwatch logo seochat tools logo