Page 1 of 1

Error importing

Posted: Wed Jul 18, 2007 8:45 am
by thefreebielife
I have been using the same code over and over when I had my stuff on PowWeb, but i just swicthed to StartLogic and now when I try to import this code:

Code: Select all

CREATE TABLE `bugs` (
  `username` text NOT NULL,
  `description` text NOT NULL,
  `date` timestamp NOT NULL default '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
I get this error:

Code: Select all

#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 'ENGINE=MyISAM DEFAULT CHARSET=latin1' at line 5 

Posted: Wed Jul 18, 2007 8:48 am
by Gente
Looks like you use different versions of MySQL. Try to import it

Code: Select all

CREATE TABLE `bugs` (
  `username` text NOT NULL,
  `description` text NOT NULL,
  `date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
);

Posted: Wed Jul 18, 2007 8:54 am
by thefreebielife
Seems to work, but what would I do with stuff like this (bottom line):

Code: Select all

CREATE TABLE `users` (
  `uId` int(6) NOT NULL auto_increment,
  `username` text NOT NULL,
  `password` text NOT NULL,
  `fname` text NOT NULL,
  `phone` text NOT NULL,
  `email` text NOT NULL,
  `address` text NOT NULL,
  `city` text NOT NULL,
  `state` text NOT NULL,
  `zip` text NOT NULL,
  `country` text NOT NULL,
  `ip` text NOT NULL,
  `gid` int(6) NOT NULL default '0',
  `rid` int(6) NOT NULL default '0',
  `ostatus` double NOT NULL default '0',
  `holdreason` text NOT NULL,
  `astatus` tinyint(4) NOT NULL default '0',
  `date` text NOT NULL,
  `deadline` text NOT NULL,
  `dead` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`uId`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
I need those increments.

Posted: Wed Jul 18, 2007 8:57 am
by Gente
Keep them. Increments should be imported without problems.

Posted: Wed Jul 18, 2007 9:03 am
by thefreebielife
Now I am getting an error with this one:

Code: Select all

CREATE TABLE `deadoffers` (
  `username` text NOT NULL,
  `offer` text NOT NULL,
  `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
) 
Is there someone I can read about what needs to be changed?

Posted: Wed Jul 18, 2007 9:12 am
by Gente
Remove

Code: Select all

ON UPDATE CURRENT_TIMESTAMP
Just follow the error messages.

Posted: Wed Jul 18, 2007 8:42 pm
by thefreebielife
I get the same error as before.

I am so confused and have no idea what to do, I didn't know different versions could mess this up.

Posted: Wed Jul 18, 2007 8:49 pm
by feyd
Why are most of the fields TEXT?

If you make the following query on the server with the error, what does it return?

Code: Select all

SELECT VERSION();

Posted: Wed Jul 18, 2007 8:52 pm
by thefreebielife
Most of the fields are text because I thought that would be the easiest since the input of most of them varies.

It returns 4.0.16

this is now causing an error:

Code: Select all

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

-- 
-- Table structure for table `offers`
-- 

CREATE TABLE `offers` (
  `oId` int(6) NOT NULL auto_increment,
  `oCampID` int(11) NOT NULL default '0',
  `oaffiliate` text NOT NULL,
  `oCost` text NOT NULL,
  `oName` text NOT NULL,
  `oDescription` text NOT NULL,
  `oLink` text NOT NULL,
  `oImage` text NOT NULL,
  `oInstructions` text NOT NULL,
  `oWait` text NOT NULL,
  `oweight` text NOT NULL,
  `ocountry` text NOT NULL,
  PRIMARY KEY  (`oId`)
) 

Posted: Fri Jul 20, 2007 4:17 pm
by califdon
Look up the proper syntax for CREATE TABLE in MySQL 4.0 http://dev.mysql.com/doc/refman/4.1/en/ ... table.html