Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [mysql] nieprawidowy zrzut z phpmyadmina, zrzut z phpmyadmina nie chce się wykonac w php
Athlan
post
Post #1





Grupa: Developerzy
Postów: 823
Pomógł: 12
Dołączył: 18.12.2005

Ostrzeżenie: (0%)
-----


Zrzuciłem sobie część bazy z systemu WordPress i wyszło takie coś:

  1. CREATE TABLE `wp_categories` (
  2. `cat_ID` bigint(20) NOT NULL AUTO_INCREMENT,
  3. `cat_name` varchar(55) NOT NULL DEFAULT '',
  4. `category_nicename` varchar(200) NOT NULL DEFAULT '',
  5. `category_description` longtext NOT NULL,
  6. `category_parent` bigint(20) NOT NULL DEFAULT '0',
  7. `category_count` bigint(20) NOT NULL DEFAULT '0',
  8. PRIMARY KEY (`cat_ID`),
  9. KEY `category_nicename` (`category_nicename`)
  10. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  11.  
  12. INSERT INTO `wp_categories` VALUES (1, 'Uncategorized', 'uncategorized', '', 0, 1);


jak wklejam to sobie do phpmyadmina to wszystko pięknie, ładnie się robi, ale chciałbym zrobić to z poziomu strony:

  1. <?php
  2.  
  3. mysql_connect('localhost','root','');
  4.  
  5. $query = "
  6. CREATE TABLE `wp_categories` (
  7. `cat_ID` bigint(20) NOT NULL auto_increment,
  8. `cat_name` varchar(55) NOT NULL default '',
  9. `category_nicename` varchar(200) NOT NULL default '',
  10. `category_description` longtext NOT NULL,
  11. `category_parent` bigint(20) NOT NULL default '0',
  12. `category_count` bigint(20) NOT NULL default '0',
  13. PRIMARY KEY (`cat_ID`),
  14. KEY `category_nicename` (`category_nicename`)
  15. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
  16.  
  17. INSERT INTO `wp_categories` VALUES (1, 'Uncategorized', 'uncategorized', '', 0, 1);
  18. ";
  19.  
  20. mysql_query($query) or die(mysql_error());
  21.  
  22. ?>


zpaytanie jest identyczne (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

ale mysql_erroo() zwraca takie coś:

Cytat
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 `wp_categories` VALUES ( 1, 'Uncategorized', 'uncategorized', '' at line 10


jak dla mnie to bardzo dziwne (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

co mam zrobić?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 10:34