Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Resource id #3
Forum PHP.pl > Forum > PHP
taqu
Witam !

  1. <?php
  2.  
  3. $lacz = mysql_connect('localhost', 'xxx', 'xxx');
  4.  
  5. $zapytanie = mysql_query("SELECT * FROM firma WHERE id=149",$lacz);
  6.  
  7. $row=mysql_fetch_array($zapytanie)
  8.  
  9. ?>
  10.  
  11. <form action="<?php $PHP_SELF ?>" method="post" target="_blank">
  12. <script type="text/javascript">
  13. <!--
  14. // Automatically calculates the editor base path based on the _samples directory.
  15. // This is usefull only for these samples. A real applica
  16.  
  17. tion should use something like this:
  18. // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
  19. var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
  20.  
  21. var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
  22. oFCKeditor.BasePath = sBasePath ;
  23. oFCKeditor.Height = 300 ;
  24. oFCKeditor.Value = '<?php echo " '.$row['tresc'].' "; ?>' ;
  25. oFCKeditor.Create() ;
  26. //-->
  27. </script>
  28. <br />
  29. <input type="submit" value="Submit" />
  30. </form>



Zamiast zawartosc kolumny TRESC dostaje taki komunikat Resource id #3

tabela,kolumna i wiersz istnieją dry.gif



po zmianie na mysql_fetch_row jest to samo :/

  1. <?php
  2.  
  3. $lacz = mysql_connect('localhost', 'xxx', 'xxx');
  4.  
  5. $zapytanie = mysql_query("SELECT tresc FROM firma WHERE id=149",$lacz);
  6.  
  7. $row=mysql_fetch_row($zapytanie)
  8.  
  9. ?>
  10.  
  11. <form action="<?php $PHP_SELF ?>" method="post" target="_blank">
  12. <script type="text/javascript">
  13. <!--
  14. // Automatically calculates the editor base path based on the _samples directory.
  15. // This is usefull only for these samples. A real application should use something
     like this:
  16. // oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.
  17. var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_samples')) ;
  18.  
  19. var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
  20. oFCKeditor.BasePath = sBasePath ;
  21. oFCKeditor.Height = 300 ;
  22. oFCKeditor.Value = '<?php
  23.  
  24. //echo " '.$row['tresc'].' ";
  25.  
  26. echo $row[0];
  27.  
  28. ?>' ;
  29. oFCKeditor.Create() ;
  30. //-->
  31. </script>
  32. <br />
  33. <input type="submit" value="Submit" />
  34. </form>
Snap
Problem tkwi w wysyłaniu zapytania do serwera MySQL. Nie ma to jak manual.
mysql_query" title="Zobacz w manualu PHP" target="_manual
taqu
A mianowicie ? smile.gif


Czytam i czytam i nic nie widze sciana.gif blinksmiley.gif
calebos
Resource id3 oznacza ze zapytanie do mysql zwrocilo dane.
Brakuje to jakiegos while'a zeby przechodzil przez tablice sqla.


ie

CODE

while($row = mysql_fetch_array($row);
{}
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.