whats rowng with this sql

Discussion in 'PHP' started by member1, Aug 4, 2007.

  1. #1
    can any one help me with this sql

    Erreur
    
    requête SQL:
    
    -- 
    -- Table structure for table `cached`
    -- 
    CREATE TABLE `cached` (
    `id` int( 11 ) NOT NULL AUTO_INCREMENT ,
    `listingid` int( 11 ) NOT NULL default '',
    `url` char( 200 ) NOT NULL default '',
    `html` text NOT NULL ,
    `createDate` datetime NOT NULL default '0000-00-00 00:00:00',
    `modifyDate` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY ( `id` )
    
    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 '' at line 12
    PHP:
    thanks
     
    member1, Aug 4, 2007 IP
  2. adsblog

    adsblog Active Member

    Messages:
    659
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    70
    #2
    place full code of sql file here .
     
    adsblog, Aug 4, 2007 IP
  3. member1

    member1 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    68
    #3
    thanks for replay this is the full code of sql
     
    member1, Aug 4, 2007 IP
  4. freshdevelopment

    freshdevelopment Notable Member

    Messages:
    1,303
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    240
    #4
    Execute each create table script seperately, and post which one causes the problem.

    I suspect a missing comma or semicolon somewhere...
     
    freshdevelopment, Aug 4, 2007 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    
    `listingid` int( 11 ) NOT NULL default '',
    
    Code (sql):
    I don't think an INT field can have a string as default value. Try 0 instead of ''.
     
    nico_swd, Aug 4, 2007 IP
  6. member1

    member1 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    68
    #6
    the last one he cose probleme

    Erreur

    requête SQL:

    --
    -- Table structure for table `cached`
    --
    CREATE TABLE `cached` (
    `id` int( 11 ) NOT NULL AUTO_INCREMENT ,
    `listingid` int( 11 ) NOT NULL default '',
    `url` char( 200 ) NOT NULL default '',
    `html` text NOT NULL ,
    `createDate` datetime NOT NULL default '0000-00-00 00:00:00',
    `modifyDate` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY ( `id` )

    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 '' at line 12
     
    member1, Aug 4, 2007 IP
  7. member1

    member1 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    68
    #7
    i modifed but is the same probleme

    Erreur

    requête SQL:
    
    -- 
    -- Table structure for table `cached`
    -- 
    CREATE TABLE `cached` (
    `id` int( 11 ) NOT NULL AUTO_INCREMENT ,
    `listingid` int( 0 ) NOT NULL default '',
    `url` char( 200 ) NOT NULL default '',
    `html` text NOT NULL ,
    `createDate` datetime NOT NULL default '0000-00-00 00:00:00',
    `modifyDate` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY ( `id` )
    
    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 '' at line 12 
    Code (markup):
     
    member1, Aug 4, 2007 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    You didn't understand what I mean.
    
    `listingid` int( 11 ) NOT NULL default 0,
    
    Code (sql):
     
    nico_swd, Aug 4, 2007 IP
  9. member1

    member1 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    68
    #9
    i change it to this but she gime error

     
    member1, Aug 4, 2007 IP
  10. nabiha

    nabiha Peon

    Messages:
    111
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Try this above statement. I feel that there is a missing closing )
     
    nabiha, Aug 4, 2007 IP
  11. member1

    member1 Active Member

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    68
    #11
    thanks yes is work
     
    member1, Aug 4, 2007 IP