OOP PHP simple question

Posted by Tristan on Stack Overflow See other posts from Stack Overflow or by Tristan
Published on 2010-05-07T20:18:33Z Indexed on 2010/05/07 20:38 UTC
Read the original article Hit count: 170

Filed under:
|

Hello,

I'm new to OOP in PHP, is that to seems correct ?

class whatever {

    Function Maths() {
    $this->sql->query($requete);

   $i = 0;

  while($val = mysql_fetch_array($this)) { 
    $tab[i][average] = $val['average'];
    $tab[i][randomData] = $val['sum'];
    $i=$i+1;
    }
        return $tab;
}

I want to access the data contained in the array

$foo = new whatever();
$foo->Maths();
 for ($i, $i <= endOfTheArray; i++) {

    echo Maths->tab[i][average];
    echo Maths->tab[i][randomData];
 }

Thank you ;)

© Stack Overflow or respective owner

Related posts about php

Related posts about oop