Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]mysql_fetch_array błąd
vegeta
post
Post #1





Grupa: Zarejestrowani
Postów: 122
Pomógł: 0
Dołączył: 9.11.2008

Ostrzeżenie: (10%)
X----


  1. <?php
  2. $_POST['idlok'] = 2;
  3. echo $_POST['idlok'];
  4. $loksql = mysql_query('SELECT `nazwa` FROM `lokale` WHERE `id` = "'.$_POST['idlok'].'"');
  5. $lokl = mysql_fetch_array($loksql);
  6. echo 'SELECT `nazwa` FROM `lokale` WHERE `id` = "'.$_POST['idlok'].'"';
  7. ?>


Output:
Kod
2
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in E:\Adam\xampp\htdocs\lifegame\kup.php on line 5
SELECT `nazwa` FROM `lokale` WHERE `id` = "2"


W PMA po wysłaniu SELECT `nazwa` FROM `lokale` WHERE `id` = "2" otrzymuję prawidłowy wynik.
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: 24.08.2025 - 06:08