SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member weird2u2's Avatar
    Join Date
    Jan 2003
    Location
    uk
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Help where do i start

    Using phpmyadmin to import mysql.txt gives this error, plz I'm very new to mysql and have not a clue where to start.

    result of import:
    -------------------------------------------------------------------------
    Error

    SQL-query :

    CREATE TABLE address_book(

    address_book_id int( 11 ) NOT NULL AUTO_INCREMENT ,
    customers_id int( 11 ) default '0' NOT NULL ,
    entry_gender char( 1 ) NOT NULL ,
    entry_company varchar( 32 ) ,
    entry_firstname varchar( 32 ) NOT NULL ,
    entry_lastname varchar( 32 ) NOT NULL ,
    entry_street_address varchar( 64 ) NOT NULL ,
    entry_suburb varchar( 32 ) ,
    entry_postcode varchar( 10 ) NOT NULL ,
    entry_city varchar( 32 ) NOT NULL ,
    entry_state varchar( 32 ) ,
    entry_country_id int( 11 ) default '0' NOT NULL ,
    entry_zone_id int( 11 ) default '0' NOT NULL ,
    PRIMARY KEY ( address_book_id ) ,
    KEY idx_address_book_customers_id( INSERT INTO address_book( address_book_id, customers_id, entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id )
    VALUES (
    '1', '1', 'm', 'ACME Inc.', 'John', 'doe', '1 Way Street', '', '12345', 'NeverNever', '', '223', '12'
    )

    MySQL said:


    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 'insert into address_book (address_book_id, customers_id, entry_

    --------------------------------------------------------------------------------

    Where and what am I looking for ??

    Please any suggestions welcome....
    Last edited by weird2u2; Sep 17, 2003 at 11:36.

  2. #2
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this...
    CREATE TABLE address_book(

    address_book_id int( 11 ) NOT NULL AUTO_INCREMENT ,
    customers_id int( 11 ) default '0' NOT NULL ,
    entry_gender char( 1 ) NOT NULL ,
    entry_company varchar( 32 ) ,
    entry_firstname varchar( 32 ) NOT NULL ,
    entry_lastname varchar( 32 ) NOT NULL ,
    entry_street_address varchar( 64 ) NOT NULL ,
    entry_suburb varchar( 32 ) ,
    entry_postcode varchar( 10 ) NOT NULL ,
    entry_city varchar( 32 ) NOT NULL ,
    entry_state varchar( 32 ) ,
    entry_country_id int( 11 ) default '0' NOT NULL ,
    entry_zone_id int( 11 ) default '0' NOT NULL ,
    PRIMARY KEY ( address_book_id ) ,
    KEY (customers_id)
    );
    INSERT INTO address_book( address_book_id, customers_id, entry_gender, entry_company, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id )
    VALUES (
    '1', '1', 'm', 'ACME Inc.', 'John', 'doe', '1 Way Street', '', '12345', 'NeverNever', '', '223', '12'
    )
    The bold bit was modified as the original wasn't defined.

    I also added a couple of parenthesis as well.
    Lats...


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
  •