I have a program which requires a database. So I made a file that could generate the sql to create it (I copied the sql from PHPmyadmin as reference). When I execute the sql I get the error:
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 '; USE `anonymusiusform`; -- ------------------------------------------------' at line 4
It's always on the first ; that the error occurs. If I execute it in PHPmyadmin it works and correctly creates the database. I think the problem lays with the 'delimiter'. I tried googling it but I didn't found anything to solve my problem. This is the sql my file generate´s:
-- -- Database: `anonymusiusform` -- CREATE DATABASE `anonymusiusform` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci; USE `anonymusiusform`; -- -------------------------------------------------------- -- -- Table structure for table `enquete` -- CREATE TABLE IF NOT EXISTS `enquete` ( `id` int(5) NOT NULL auto_increment, `ip` varchar(16) NOT NULL, `host` varchar(50) NOT NULL, `age` varchar(2) NOT NULL, `name` varchar(50) NOT NULL, `rank` varchar(8) NOT NULL, `opmerking` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
Any help would be highly appreciated. Edit: The layout seems messed up, I don't get what's wrong. Sorry about it. It doesn't seems to recognize enters anymore.