My own CLASS ?
| From: | Andrew S | Date: | Wed, 08 May 2002 14:12:47 +0000 |
| Subject: | My own CLASS ? | ||
| Groups: | php.pear.webmaster | ||
| Request: | Send a blank email to pear-webmaster+get-90@lists.php.net to get a copy of this message | ||
Hello dear pear-webmaster.
I`m new into PEAR.
Before this time i`d use own classes & i like it.
But now i don`t understand how i can use PEAR with my own class.
Examle:
// my class
class OFFICE
{
// Properties
...
var $db;
// consturcor
function OFFICE()
{
...
$this->db = DB::connect($dsn, true);
// With DB::isError you can differentiate between an error or
// a valid connection.
if (DB::isError($db)) {
die ($db->getMessage());
}
}
// methods ...
}
so if i wnat use $db object into my own class OFFICE i need use like :
$this->db->query('something');
what i need to do for use in OFFICE like : $this->query('some...');
may be
class OFFICE extends DB
{ ...
or
class OFFICE extends mysql.php
{ ...
8 мая 2002 г. 18:12 Andrew B. Sokov
———————————————————————————————————————————————————————————————————————
http://j8.spb.ru | me@j8.spb.ru | ICQ UIN 16793554
———————————————————————————————————————————————————————————————————————