Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> pear:db, wamp server - kod przestaje sie wykonywac, nie wiem co jest nie tak
-Gość_Sopel-
post 13.02.2005, 23:24:53
Post #1





Goście







  1. <?php
  2. require_once(&#092;"./DB/DB.php\");
  3.  
  4. class DataAccess {
  5. var $db, $result;
  6. function __construct() {
  7. $db_inf = new XMLConfig('config.xml');
  8. $dsn = $db_inf->getDbtype().&#092;"://\".$db_inf->getUser().\":\".$db_inf->getPassword().\"@\".$db_inf->getHost().\"/\".$db_inf->getDbname();
  9. $this->db =& DB::connect($dsn);
  10. if (DB::isError($this->db)) {
  11. die ($this->db->getMessage());
  12. }
  13. $this->db->autoCommit(true);
  14. }
  15. function query($sql) {
  16. $this->result = $this->db->query($sql);
  17. if (DB::isError($this->result)) {
  18. return false;
  19. } else {
  20. return true;
  21. }
  22. }
  23. function fetchRow() {
  24. if ($this->result->fetchInto($row)) {
  25. return $row;
  26. } else {
  27. return false;
  28. }
  29. }
  30. }
  31. ?>


klasa do obslugi polaczenia z baza danych. dane z pliku xml pobierane sa prawidlowo i $dsn jest ustawiony dobrze.. problem polega na tym, ze skrypt przestaje sie wykonywac po $this->db =& DB::connect($dsn);.. probowalem kilku rzeczy i nic...

znalazlem w google taki przyklad:
  1. <html>
  2. <body>
  3. <?php
  4.  function handle_errors ($error, $message, $filename, $line) {
  5.  ob_end_clean( );
  6.  echo &#092;"<b>$message</b> in line $line of <i>$filename</i></body></html>\";
  7.  exit;
  8.  }
  9.  set_error_handler('handle_errors');
  10.  ob_start( );
  11. ?>
  12.  
  13. <?php
  14.  require_once('./DB/DB.php');
  15.  $db = new DB();
  16.  $db->connect('mysql://localhost/internet_shop');
  17.  if (DB::iserror($db)) die($db->getMessage( ));
  18.  // ...
  19. ?>
  20. </table>
  21. </body>
  22. </html>

no i wyswietlil mi sie blad: Assigning the return value of new by reference is deprecated in line 310 of c:\wamp\www\Sklep\DB\DB.php..

pomozcie prosze
Go to the top of the page
+Quote Post

Posty w temacie
- Gość_Sopel   pear:db, wamp server - kod przestaje sie wykonywac   13.02.2005, 23:24:53
- - Gość_Sopel   jakby ktos mial taki sam problem: byl to konflikt ...   14.02.2005, 15:28:17


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: 19.07.2025 - 01:30