Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] nie dzialaja metody rodzica w klasie dziedzinej
become
post
Post #1





Grupa: Zarejestrowani
Postów: 88
Pomógł: 0
Dołączył: 12.01.2007

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


  1. <?php
  2. Class myDB extends DB {
  3.  
  4.  function selectUsers($element) {
  5. $q="
  6. SELECT *
  7. FROM users
  8. WHERE id=$element
  9. ";
  10. $res=$this->getRow($q, array(), DB_FETCHMODE_ASSOC);
  11. if (PEAR::isError($res)) {
  12.  die($res->getMessage() . ' | ' . $res->getDebugInfo());
  13. }
  14.  }
  15.  
  16. }
  17. ?>


wywala błąd
Call to undefined method myDB::getRow()

getRow jest metodą clasy DB pakietu PEAR

próbowałem przez parent::getRow ale jest dokładnie to samo.

Ten post edytował become 23.01.2007, 11:39:31
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
become
post
Post #2





Grupa: Zarejestrowani
Postów: 88
Pomógł: 0
Dołączył: 12.01.2007

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


sory, ale nie mam zielonego pojecia jak to zrobic ... moze jakis przyklad ?

  1. <?php
  2. Class myDB_common extends DB_common {
  3.  
  4.  function selectUsers($element) {
  5. $q="
  6. SELECT *
  7. FROM users
  8. WHERE id=$element
  9. ";
  10. $res=$this->getRow($q, array(), DB_FETCHMODE_ASSOC);
  11. if (PEAR::isError($res)) {
  12.  die($res->getMessage() . ' | ' . $res->getDebugInfo());
  13. }
  14.  }
  15. }
  16. ?>


jezeli polacze sie tworzac nowy obiekt z klasy DB

$db =& DB::connect($dsn, $options);

to przeciez w wyniku mam obiekt klasy DB_common a nie myDB_common i nie bede mial dostepu do metody selectUser

Ten post edytował become 23.01.2007, 13:02:34
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: 25.12.2025 - 22:16