Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> dziwny błąd
Cysiaczek
post 9.02.2005, 15:16:24
Post #1





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Taki oto skrypt tworzący bazę danych.
  1. <?
  2. mysql_connect (&#092;"localhost\", \"login\", \"hasło\") or
  3. die (&#092;"Nie można połaczyć się z MySql\");
  4. mysql_select_db (&#092;"nazwa_bazy\") or die (\"Nie można znalesc bazy\");
  5.  
  6. $query=mysql_query &#092;"CREATE TABLE 'ankieta1' ('nr' INT NOT NULL AUTO_INCREMENT ,
  7. 'wartosc' INT NOT NULL ,
  8. 'ktora' INT NOT NULL ,
  9. UNIQUE (
  10. 'nr' 
  11. )
  12. )&#092;";
  13. ?>


wywala błąd
Kod
parse error, unexpected T_CONSTANT_ENCAPSED_STRING


Możecie powiedzieć, co jest nie tak


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
mhs
post 9.02.2005, 15:29:09
Post #2





Grupa: Zarejestrowani
Postów: 764
Pomógł: 3
Dołączył: 30.04.2003

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


  1. <?php
  2. mysql_connect (&#092;"localhost\", \"login\", \"hasło\") or
  3. die (&#092;"Nie można połaczyć się z MySql\");
  4. mysql_select_db (&#092;"nazwa_bazy\") or die (\"Nie można znalesc bazy\");
  5.  
  6. $query=mysql_query(&#092;"CREATE TABLE 'ankieta1' ('nr' INT NOT NULL AUTO_INCREMENT ,
  7. 'wartosc' INT NOT NULL ,
  8. 'ktora' INT NOT NULL ,
  9. UNIQUE (
  10. 'nr' 
  11. )
  12. )&#092;")
  13. ?>



questionmark.gifquestionmark.gifquestionmark.gifquestionmark.gifquestionmark.gifquestionmark.gifquestionmark.gif
Go to the top of the page
+Quote Post
Cysiaczek
post 9.02.2005, 16:46:59
Post #3





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Ok. Dzięki, ale nie o to chodziło. trzeba było dać

  1. <?php
  2.  
  3. $query=&#092;"ble ble ble\";
  4. $wynik=mysql_query($query);
  5.  
  6. ?>


Dopiero wtedy poszło. Co za dziwny serwer

Ten post edytował Cysiaczek 9.02.2005, 16:47:18


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
popbart
post 9.02.2005, 18:16:56
Post #4





Grupa: Zarejestrowani
Postów: 255
Pomógł: 0
Dołączył: 22.04.2004
Skąd: Żoliborz

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


Chodziło o to, bo nie dałeś nawiasu
Cytat
mysql_query " CREATE TABLE
winksmiley.jpg


--------------------
Visual Basic - kto by pomyślał :)
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 18.07.2025 - 11:11