Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]błąd mysql
Pcbecaw
post
Post #1





Grupa: Zarejestrowani
Postów: 236
Pomógł: 0
Dołączył: 4.06.2011

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


Gdy dodaję taki kod do phpmyadmin:
  1. CREATE TABLE ´informit_tags´ (
  2. ´id´ int(11) NOT NULL auto_increment,
  3. ´name´ varchar(50) NOT NULL default ’’,
  4. ´count´ int(11) NOT NULL default ’0’,
  5. PRIMARY KEY (´id´)
  6. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=17

Wywala mi błąd:#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 '’’, ´count´ int(11) NOT NULL default ’0’, PRIMARY KEY (´id´) ) ' at line 3
O co chodzi?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
IceManSpy
post
Post #2





Grupa: Zarejestrowani
Postów: 1 006
Pomógł: 111
Dołączył: 23.07.2010
Skąd: Kraków

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


Chodzi o poprawnie napisane zapytanie:
  1. CREATE TABLE informit_tags (
  2. id int(11) NOT NULL AUTO_INCREMENT,
  3. name varchar(50) NOT NULL DEFAULT '',
  4. count int(11) NOT NULL DEFAULT '0',
  5. PRIMARY KEY (id)
  6. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=17


Ten post edytował IceManSpy 11.06.2011, 23:42:30
Go to the top of the page
+Quote Post
Pcbecaw
post
Post #3





Grupa: Zarejestrowani
Postów: 236
Pomógł: 0
Dołączył: 4.06.2011

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


Dzięki, próbowałem poprawiać jeszcze to:
  1. INSERT INTO ´informit_tags´ (´id´, ´name´, ´count´) VALUES (1, ’ajax’, 20),
  2. (2, ’php’, 25),
  3. (3, ’mysql’, 5),
  4. (4, ’javascript’, 10),
  5. (5, ’coldfusion’, 25),
  6. (6, ’java’, 2),
  7. (7, ’html’, 50),
  8. (8, ’css’, 30),
  9. (9, ’actionscript’, 20),
  10. (10, ’c#’, 40),
  11. (11, ’dhtml’, 10),
  12. (12, ’xml’, 15),
  13. (13, ’xhtml’, 30),
  14. (14, ’visual basic’, 1),
  15. (15, ’cfml’, 20),
  16. (16, ’asp’, 30);

usuwałem te odwrocone apostrofy i nic. Gdzie to trzeba poprawiać?

to
  1. ’
jest tym ' (tyle że odwróconym), nie wiem dlaczego tak się wyświetla

Ten post edytował Pcbecaw 11.06.2011, 23:50:59
Go to the top of the page
+Quote Post
IceManSpy
post
Post #4





Grupa: Zarejestrowani
Postów: 1 006
Pomógł: 111
Dołączył: 23.07.2010
Skąd: Kraków

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


Bo nie ma być odwrócony apostrof, tylko zwykły. Taki -> '
  1. INSERT INTO ´informit_tags´ (´id´, ´name´, ´count´) VALUES (1, 'ajax', 20),
  2. (2, 'php', 25),
  3. (3, 'mysql', 5),
  4. (4, 'javascript', 10),
  5. (5, 'coldfusion', 25),
  6. (6, 'java', 2),
  7. (7, 'html', 50),
  8. (8, 'css', 30),
  9. (9, 'actionscript', 20),
  10. (10, 'c#', 40),
  11. (11, 'dhtml', 10),
  12. (12, 'xml', 15),
  13. (13, 'xhtml', 30),
  14. (14, 'visual basic', 1),
  15. (15, 'cfml', 20),
  16. (16, 'asp', 30);


Ten post edytował IceManSpy 12.06.2011, 00:03:43
Go to the top of the page
+Quote Post
Pcbecaw
post
Post #5





Grupa: Zarejestrowani
Postów: 236
Pomógł: 0
Dołączył: 4.06.2011

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


Wyświetla się taki błąd:
  1. #1146 - Table 'testy.´informit_tags´' doesn't exist
  2. INSERT INTO ´informit_tags´( ´id´, ´name´, ´count´ )
  3. VALUES ( 1, 'ajax', 20 ) , ( 2, 'php', 25 ) , ( 3, 'mysql', 5 ) , ( 4, 'javascript', 10 ) , ( 5, 'coldfusion', 25 ) , ( 6, 'java', 2 ) , ( 7, 'html', 50 ) , ( 8, 'css', 30 ) , ( 9, 'actionscript', 20 ) , ( 10, 'c#', 40 ) , ( 11, 'dhtml', 10 ) , ( 12, 'xml', 15 ) , ( 13, 'xhtml', 30 ) , ( 14, 'visual basic', 1 ) , ( 15, 'cfml', 20 ) , ( 16, 'asp', 30 ) ;


Były małe błędy, ale już poprawiłem (IMG:style_emoticons/default/snitch.gif)
Go to the top of the page
+Quote Post

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: 26.09.2025 - 16:46