Re: Addition to DB/common.php ?
| From: | Kendrick Vargas | Date: | Fri, 02 Feb 2001 16:25:40 +0000 |
| Subject: | Re: Addition to DB/common.php ? | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-1250@lists.php.net to get a copy of this message | ||
On Fri, 2 Feb 2001, Chuck Hagenbuch wrote:
> Quoting Kendrick Vargas <ken@hudat.com>:
>
> > Actually, I'd writting a class some time ago to do this. I'd been meaning
> > Would there be any use for that here? Would anyone want me to post it? I
> > have no formal education in programming, so I guess I'd be a little
> > nervous about having experienced people poking and prodding at my stuff,
> > but if it's useful I'd love to post it and have it included.
>
> If you're willing to post the code, post the code. :) It sounds interesting -
> although again, not something that should be in the core DB or DB_common
> classes - and if there's interest in it, I'm sure someone will volunteer to
> convert it.
Well, here goes... :-)
I call it my Data_Container. I usually extend it like so:
class Domain_Info extends Data_Container {
var $table_name = "dns_zones";
var $id_name = "zone_id";
var $db = "";
function Domain_Info ($id = "") {
$this->db = new DB_Connection("temp_auth");
if ( $this->Container_Init($id) ) {
return(true);
} else {
return(false);
}
}
}
I try to return true or false on just about everything. And if I return
false, I try to set the internal $Error variable. Anyways... Feel free
-peace
--- BEGIN GEEK CODE BLOCK ----------+----------
GAT d- s:+ !a C++$ UL/S/I/B++++$ P+ | "In the ongoing battle between objects
L++ E- W+(+++) N K- w(---) O-- M@ | made of aluminum going hundreds of
V(--) PS+++ PE Y+ PGP@ t++ 5 X+ R- | miles per hour and the ground going
tv+ b- DI++++ D+(+++) G e>++ h--- | zero, the ground has yet to lose."
r++ z+>+++ - END GEEK CODE BLOCK ---+