PEAR mysql extension [was :Re: [PEAR-DEV] Pear DB Tutorial]
| From: | Markus Fischer | Date: | Sat, 19 May 2001 09:09:16 +0000 |
| Subject: | PEAR mysql extension [was :Re: [PEAR-DEV] Pear DB Tutorial] | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-398@lists.php.net to get a copy of this message | ||
Hi Stig,
On Sun, Apr 15, 2001 at 06:20:44PM -0400, Stig Sæther Bakken wrote :
> ["Tomas V.V.Cox" <cox@idecnet.com>]
> > Luc Saint-Elie wrote:
> > >
> > > And another thing
> > > die ($db->getMessage())
> > > throws : Warning: ini_set() has been disabled for security reasons. in
> > > mysql.php on line 105
> > >
> >
> > Houston, we have a problem :)
> >
> > Stig, perhaps maybe many ISPs don't accept ini_set. What do you think
> > about change ini_* with ob_*?
> >
> > ob_start();
> > $conn = mysql_connect(..);
> > $error = ob_get_contents();
> > ob_end_clean();
> > if (!$conn)
> > ...
>
> It's not foolproof, if you've configured PHP to send errors elsewhere,
> or to not display warnings, you won't get anything. But it's better
> than nothing.
The mysql extension has changed in the meantime. Thanks to Jason
mysql_error() now returns the correct error message (the previous
behaviour was just to return nothing) and the hack with ini_set()
and $php_errormsg is no longer needed.
The attached diff accomodates this behaviour.
- Markus