SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2007
    0 Post(s)
    0 Thread(s)

    Unhappy MYSQL help needed

    Hi All

    I am having troubles trying to create my first table in mysql

    I am using version 5.0

    I have entered the code below in mysql:

    mysql>CREATE TABLE table_name (
    -> column_1_name column_1_type column_1_details,
    -> column_2_name column_2_type column_2_details,
    -> ...

    and i get the following error:

    ERROR 1064 (42000): You have an error in your SQL syntax;check the manual that corresponds to your Mysql server version for the right syntax to use near 'column_1_type column_1_details,column_2_name column_2_type column_2_details,' at line 2

    Anyone able to help?

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Toronto, Canada
    63 Post(s)
    3 Thread(s)
    "column_1_type" is not a valid datatype

    you need something like DATETIME, INTEGER, or VARCHAR(42)

    nor will "column_1_details" work either, you actually have to code some valid details, like PRIMARY KEY, NOT NULL, DEFAULT 'no way', and so on | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Posting Permissions

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