Home » Database » DB » Bug #696
Some notices can appear
Details
| Submitted | 2004-02-06 11:55 UTC |
|---|---|
| From | smailling at free dot fr |
| Assigned | danielc |
| Status | Closed |
| Package | DB |
| PHP Version | Irrelevant |
| OS | Windows 2000 |
| Roadmaps | (Not assigned) |
Comments
[2004-02-06 11:55 UTC] smailling at free dot fr
Description:
------------
If we don't specify the port in the dsn, a notice can occur.
I added some other check that can appear sometimes.
Reproduce code:
---------------
RCS file: /repository/pear/DB/DB/mysql.php,v
retrieving revision 1.56
diff -w -b -r1.56 mysql.php
123c123
< if ($dsninfo['port']) {
---
> if (isset($dsninfo['port'])) {
212c212
< if (!@mysql_select_db($this->_db, $this->connection)) {
---
> if (!is_resource($this->connection) || !@mysql_select_db($this->_db, $this->connection)) {
762a763
> if (is_resource($this->connection))
764c765
< @mysql_errno($this->connection) . ' ** ' .
---
> @mysql_errno($this->connection) . " ** " .
765a767,770
> else
> return $this->raiseError($errno, null, null, null,
> @mysql_errno() . " ** " .
> @mysql_error());