Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> mysql_fetch_array():, Wszystko dobrze a jednak mu cos nie pasi
Haptor
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 15.05.2005

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


Witam! Jestem strasznie zirytowany (IMG:http://forum.php.pl/style_emoticons/default/dry.gif) Robie sobie stronke i wszystko jest ok ... dane z bazy mysql sa prezentowane i mimo to powstaje błąd

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/w/n/z/wnz/www/func.php on line 8
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 '' at line 1

Tresc pliku func.php wyglada nastepujaco:

  1. <?
  2.  
  3. function WierszM(){
  4.  
  5. $pol=mysql_connect("mysql.60free.ovh.org","*********","********");
  6. mysql_select_db ("wnz", $pol);
  7. $wyn=mysql_query ("SELECT * FROM milosne WHERE id = $id", $pol);
  8. while($poka=mysql_fetch_array($wyn)) // tu jest niby blad
  9. {
  10. echo"<b><font color='#FeFec0'>".$poka["tytul"];
  11. echo"</font></b>".$poka["tresc"];
  12. }
  13. }
  14. ?>


Prosilbym o pomoc gdyz kazdy nastepny dzien pogarsza moia sytuacje psycho-fizyczna (IMG:http://forum.php.pl/style_emoticons/default/blink.gif)

Z góry thx
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
tiraeth
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 789
Pomógł: 41
Dołączył: 30.10.2003
Skąd: Wrocław

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


  1. <?
  2. function WierszM()
  3. {
  4.  global $id;
  5.  
  6.  $pol = mysql_connect("host:port","login","haslo") or die(mysql_error());
  7.  mysql_select_db("baza", $pol) or die(mysql_error());
  8.  
  9.  $wyn = mysql_query("SELECT * FROM milosne WHERE id = ".(int)$id, $pol) or die(mysql_error());
  10.  
  11.  while($poka=mysql_fetch_array($wyn))
  12.  {
  13. echo"<b><font color='#FeFec0'>".$poka["tytul"];
  14. echo"</font></b>".$poka["tresc"];
  15.  }
  16. }
  17. ?>
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: 4.10.2025 - 00:02