Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> jak wykonać metodę na ...
krk82
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 23.02.2007

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


Witam
Mamy klasę:
  1. <?php
  2. class DB{
  3.  
  4.  function Execute( $query ) {
  5. return mysql_query( $query );
  6. }
  7.  
  8.  function FetchRow(){
  9. ma wyświetlać kolejne rekordy
  10. }
  11.  
  12. }
  13. ?>


Nastepnie robimy:
  1. <?php
  2. $result = $db->Execute("SELECT * FROM ".TABLE_LANG."");
  3. while($Aresult = $result->FetchRow()){
  4. }
  5. ?>


i dostaje:
Fatal error: Call to a member function FetchRow() on a non-object in ...

I pytanie jak to zrobić ? Tzn co powinna zwracać Execute aby można było na tym co zwróci wykonać metodę FetchRow() ?
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 19.08.2025 - 02:46