sql table

Discussion in 'PHP' started by member1, Jun 3, 2007.

  1. #1
    hi all there is anyone he know how create this table becose

    he give me eroor all the time please any help

    
    Create a table in your sql database named search with the following:
    id (INT) Length: 10 - auto_increment - primary key
    query (VARCHAR) Length: 50  (Change 50 to the maximum length search you want)
    searches (INT) Length: 10
    PHP:
    i creat it like this he give me error
    CREATE TABLE search (
      id (INT) Length: 10 - auto_increment - primary key
      query (VARCHAR) Length: 50  (Change 50 to the maximum length search you want)
      searches (INT) Length: 10
    )
    PHP:

    Erreur
    
    requête SQL:
    
    CREATE TABLE search(
    id(
    INT
    )Length :10 - AUTO_INCREMENT - PRIMARY KEY query(
    VARCHAR
    )Length :50(
    CHANGE 50 TO the maximum length search you want
    )searches(
    INT
    )Length :10
    )
    
    MySQL a répondu:Documentation
    #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 '(INT) Length: 10 - auto_increment - primary key
      query (VARCHAR) Length: 50  (' at line 2 
    PHP:

     
    member1, Jun 3, 2007 IP
  2. wing

    wing Active Member

    Messages:
    210
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    58
    #2
    CREATE TABLE `search` (
    `id` INT( 10 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `query` VARCHAR( 50 ) NOT NULL ,
    `searches` INT( 10 ) NOT NULL
    ) ENGINE = MYISAM ;
     
    wing, Jun 3, 2007 IP
  3. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #3
    In case you were wondering, member1, the instructions were details on what to put in an "add table form", such as the one in phpMyAdmin.
     
    krt, Jun 3, 2007 IP
  4. member1

    member1 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    68
    #4
    thanks wing and krt thanks you all for help in me
     
    member1, Jun 3, 2007 IP
  5. member1

    member1 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    68
    #5
    hi can anyone tell me whats rong with this script becose he dont show anything just , anyone he make search he show just ,


     
    member1, Jun 4, 2007 IP