90 users online (0 members and 90 guests)  


  Results 1 to 4 of 4

Related

  1. Problem with mail-script    Forum: PHP Forum
    Replies: 0
  2. problem while executing cgi script    Forum: CGI Perl Forum
    Replies: 9
  3. problem with formmail script.    Forum: CGI Perl Forum
    Replies: 1
  4. problem script with older browsers    Forum: Javascript Forum
    Replies: 1
  5. cgi script/perl problem    Forum: CGI Perl Forum
    Replies: 4
  1. #1
    Ic3y's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2007
    Posts
    2

    Problem with my script

    Hey all
    I am having trouble with my MSQL dump script

    here is the extract that I have
    CREATE TABLE galaxy(id int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
    x smallint( 5 ) unsigned NOT NULL default '0',
    y smallint( 5 ) unsigned NOT NULL default '0',
    name varchar( 120 ) default 'Far Far Away',
    pic varchar( 255 ) default NULL ,
    gc int( 10 ) unsigned default '0',
    mow int( 10 ) unsigned default '0',
    moc int( 10 ) unsigned default '0',
    mod int( 10 ) unsigned default '0',
    text text, <---(I believe this is my error here)
    members tinyint( 3 ) unsigned default '0',
    exile_date datetime NOT NULL default '0000-00-00 00:00:00',
    exile_id int( 10 ) unsigned default '0',
    metal bigint( 20 ) unsigned default '0',
    crystal bigint( 20 ) unsigned default '0',
    eonium bigint( 20 ) unsigned default '0',
    donation_date datetime default '0000-00-00 00:00:00',
    PRIMARY KEY ( id ) ,
    KEY x_y( x, y ) ,
    KEY exile_id( exile_id )
    ) TYPE = MYISAM ;

    and the error that it comes up with is
    #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 'mod int(10) unsigned default '0',
    text text,
    members tinyint(3) unsigned d' at line 10
    could someone please advise me on how I can edit this to make it work that would be much appreciated

    Thanks in advance
    Ic3y

  2. #2
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Problem with my script

    It's prbably not allowing a column named text - that's a reserved word.

  3. #3
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Problem with my script

    Text is fine as a data element name. It's mod that it doesn't like (I tested it on my server). Change that data element name to something else and you'll be fine.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  4. #4
    Ic3y's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2007
    Posts
    2

    Re: Problem with my script

    CREATE TABLE galaxy(id int( 10 ) unsigned NOT NULL AUTO_INCREMENT ,
    x smallint( 5 ) unsigned NOT NULL default '0',
    y smallint( 5 ) unsigned NOT NULL default '0',
    name varchar( 120 ) default 'Far Far Away',
    pic varchar( 255 ) default NULL ,
    gc int( 10 ) unsigned default '0',
    mow int( 10 ) unsigned default '0',
    moc int( 10 ) unsigned default '0',
    mod int( 10 ) unsigned default '0',
    text text, <---(Not the error)
    members tinyint( 3 ) unsigned default '0',
    exile_date datetime NOT NULL default '0000-00-00 00:00:00',
    exile_id int( 10 ) unsigned default '0',
    metal bigint( 20 ) unsigned default '0',
    crystal bigint( 20 ) unsigned default '0',
    eonium bigint( 20 ) unsigned default '0',
    donation_date datetime default '0000-00-00 00:00:00',
    PRIMARY KEY ( id ) ,
    KEY x_y( x, y ) ,
    KEY exile_id( exile_id )
    ) TYPE = MYISAM ;
    the error was the mod located above text text it was mod as mod is known as a keypoint so I edited that and the script worked fine

    thanks for the support guys

    Ic3y



Tags for this Thread