Hi, Im moving a site from one location to another. I exported the data from the database using php myadmin to a .sql file. Im now trying to run the .sql file as a SQL query as the new host does not allow import. But im getting an error in my syntax? #1064 - You have an error in your SQL syntax near 'ENGINE=MyISAM AUTO_INCREMENT=112 DEFAULT CHARSET=latin1 AUTO_INCREMENT=112 ' at line 27 -- phpMyAdmin SQL Dump -- version 2.8.0.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Sep 27, 2006 at 01:45 PM -- Server version: 4.1.21 -- PHP Version: 4.4.2 -- -- Database: `bizr_ukpcdatabase` -- -- -------------------------------------------------------- -- -- Table structure for table `suppliers` -- CREATE TABLE `suppliers` ( `id` int(3) NOT NULL auto_increment, `sup_name` varchar(125) NOT NULL default '', `sup_address` text NOT NULL, `sup_postcode` varchar(20) NOT NULL default '0', `sup_telephone` varchar(50) NOT NULL default '', `sup_postcode_md5` varchar(8) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=112 DEFAULT CHARSET=latin1 AUTO_INCREMENT=112 ; -- -- Dumping data for table `suppliers` -- INSERT INTO `suppliers` VALUES (1, 'Floribunda', 'Unit 1 Alla Vale Ind Estate \r\nMoor Park Road \r\nKingskerswell \r\nNewton Abbot \r\nDevon ', 'TQ125AZ', '01803 293805', '72d6338e'); PHP: Can someone see a problem?
Thanks. I asked my hosts to update mySql and after removing the line you suggested (which i tried previous and it failed later at the first insert) it works fine. Thanks again!
Just note that when you get erros liek that, you need to 1. check your version of MySQL you are using 2. check to make sure your DB it the same type of charset now to be on the safe side of things, just double check your table and ensure that the id field is set to auto incremented and that the last id matches.