Re: mysql connect function in my class
| From: | Curt Zirzow | Date: | Thu, 15 Apr 2004 03:48:43 +0000 |
| Subject: | Re: mysql connect function in my class | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183409@lists.php.net to get a copy of this message | ||
* Thus wrote Greg Donald (destiney@destiney.com):
> On Wednesday 14 April 2004 07:12 pm, Andy B wrote:
> > function Connect($host, $mysqluser, $mysqlpwd){
> > $link=mysql_connect($host, $mysqluser, $mysqlpwd)
> > if(!$link){ return false; }
> > else { return $link; }}
> > should i keep it like this or is it better for the function itself to deal
> > with error handling at the same time? i.e. should it return an error
> > message/number or something of that sort or give the returned resource over
> > to some other function that deals with errors....
> >
> > it works just fine the way it is just trying to come up with some ideas
> > that would add more functionality to it if possible...
>
> Why reinvent the wheel?
>
> http://pear.php.net/packages.php?catpid=7&catname=Database
well, sometimes its necessary to invent a wheel that actually is
round :)
Curt
--
"I used to think I was indecisive, but now I'm not so sure."