Re: PHP CODE ERROR?
| From: | Piotr Pluciennik | Date: | Mon, 17 Nov 2003 14:24:38 +0000 |
| Subject: | Re: PHP CODE ERROR? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-22124@lists.php.net to get a copy of this message | ||
You've not defined any method for your class.
Read comments with ****** below.
HTH
Piotr
// Defining the Class's Properties -------
class Table
{
var $table_array = array();
var $headers = array();
var $cols;
} ********* here you've ended your class definition
********* so below it's not a constructor...
//Creating a Constructor ------
function Table( $headers )
{
$this->headers = $headers;
$this->cols = count ( $headers );
}
********* and addrow isn't also a member function of
your class
//The addROw() Method ------
function addRow( $row )
{
if ( count ($row) != $this->cols )
return false;
array_push($this->table_array, $row);
return true;
}
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree