Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP]Błąd z odbieraniem rekordu z bazy
Komiłaj
post
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 10.12.2010

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


Potrzebuję pomocy. Kiedy chcę wyciągnąć rekord z bazy, strona zwraca mi:

BŁĄD Something is wrong in your syntax obok ''strony' WHERE 'id' = 1' w linii 1

(na końcu adresu dodaję ?site=1)
(w header.php skrypt łączy się z bazą)
plik index.php:


  1. <?php
  2. include('includes/header.php');
  3.  
  4. ini_set('display_errors','1');
  5.  
  6. if (!isset($_GET['site']))
  7. $site=1;
  8.  
  9. else
  10. $siteID = mysql_fetch_array(mysql_query("SELECT 'id' FROM 'strony' WHERE 'id' = ".$_GET['site']) or die('BŁĄD '.mysql_error()));
  11. $tresc = mysql_fetch_array(mysql_query("SELECT 'tresc' FROM 'strony' WHERE 'id' = ".$siteID) or die('BŁĄD '.mysql_error()));
  12. $tytul = mysql_fetch_array(mysql_query("SELECT 'tytul' FROM 'strony' WHERE 'id' = ".$siteID) or die('BŁĄD '.mysql_error()));
  13.  
  14. echo ("<b> ".$tytul."</b><br />");
  15. echo $tresc;
  16.  
  17. echo ("<br /><br />");
  18.  
  19. include('includes/footer.php');
  20. ?>
  21.  
  22.  


Przy czym nie widzę tam błędu. Może dlatego, że jestem laikiem (IMG:style_emoticons/default/smile.gif)
Cóż zaradzić?

BTW zrzut bazy:
(IMG:http://axem.az.pl/screenshooter/uploads/o2w9zhijqu7vbm3.jpg)

Ten post edytował Komiłaj 10.12.2010, 23:41:54
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: 23.08.2025 - 20:25