$sql = "CREATE TABLE `posts` ( `id` smallint(6) NOT NULL auto_increment, `data` varchar(16) NOT NULL default '', `tresc` text NOT NULL, `autor` smallint(6) NOT NULL default '', `temat` smallint(6) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM; CREATE TABLE `topics` ( `id` smallint(6) NOT NULL auto_increment, `temat` varchar (64) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM; CREATE TABLE `users` ( `userid` smallint(6) NOT NULL auto_increment, `posts` smallint (6) NOT NULL default '', `name` varchar (64) NOT NULL default '', `mail` varchar (64) NOT NULL default '', `www` varchar (64) default '', `opis` text default '', `pass` varchar (64) NOT NULL default '', PRIMARY KEY (`userid`) ) TYPE=MyISAM; CREATE TABLE `news` ( `id` smwszystkieint(6) NOT NULL auto_increment, `data` varchar(16) NOT NULL default '', `tresc` text NOT NULL, `temat` varchar(64) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM; CREATE TABLE `komentarze` ( `id` smwallint(6) NOT NULL auto_increment, `newsid` smallint(6) NOT NULL auto_increment, `tresc` text NOT NULL, `autor` smallint(6) NOT NULL default '', PRIMARY KEY (`id`) ) TYPE=MyISAM; CREATE TABLE `config` ( `name` varchar(64) NOT NULL default '', `value` varchar(64) NOT NULL default '', PRIMARY KEY (`name`) ) TYPE=MyISAM; CREATE TABLE `chat` ( `id` smallint(6) NOT NULL auto_increment, `autor` smallint(6) NOT NULL default '', `tresc` text NOT NULL, PRIMARY KEY (`id`) ) TYPE=MyISAM; ";
wywala
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 '; CREATE TABLE `topics` ( `id` smallint(6) NOT NULL auto_increment, `temat` v' at line 8 )
a przy
$sql = "INSERT INTO `users` VALUES ('', '0', '".$_POST['user']."', '".$_POST['mail']."', '".$_POST['domain'].$_POST['path']."', 'Administrator', '".md5($_POST['pass'])."'); INSERT INTO `topics` VALUES ('', 'Testowy temat'); INSERT INTO `posts` VALUES ('', '".date(d.'.'.m.'.'.y.', '.H.':'.i)."', 'Tresc testowego posta', '1', '1'); INSERT INTO `news` VALUES ('', '".date(d.'.'.m.'.'.y.', '.H.':'.i)."', 'Tresc testowego newsa', 'Testowy news'); INSERT INTO `config` VALUES ('domain', '".$_POST['domain']."'); INSERT INTO `config` VALUES ('path', '".$_POST['path']."'); INSERT INTO `config` VALUES ('npp', '10');";
wywala
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 '; INSERT INTO `topics` VALUES ('', 'Testowy temat'); INSERT INTO `posts` VALUES ' at line 1 )
Łączność z bazą danych następuje prawidłowo (skrypt wyświetla poprawność wykonania poszczególnych etapów), tylko problemy z tym SQLem... gdy wykonuję te zapytania przez phpMyAdmina, to.... wszystko idzie dobrze Czego to może być wina?