SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    UK
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question SQL syntax error!!! please Help

    Hi

    I'm using the sitepoint book Build Your Own Database Driven Website Using PHP & MySQL and I am creating my first table I have copied the script as I have seen in the book and I'm getting a SQL syntax error

    CREATE TABLE table_name (

    column_1_name column_1_type column_1_details,
    column_2_name column_2_type column_2_details,
    ...
    );

    when I type this in I get the following back!

    MySQL said:
    #1064 - 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 co

    what am I doing wrong???

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,340
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    you're supposed to substitute some actual names, datatypes, and details for each of those

    for example,

    CREATE TABLE customers
    ( customerid integer not null primary key
    , customername varchar(99) not null
    ...
    );
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    Jan 2005
    Location
    UK
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks very much, I went back to the book and figured that out it's not written very well in regard to someone who is a novice, following it to the letter and got confusded! but thanks for your help....


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
  •