From:             thbley at gmail dot com
Operating system: win7 x64
PHP version:      5.5.0alpha1
Package:          MySQLi related
Bug Type:         Feature/Change Request
Bug description:Add dbname to mysqli_prop

Description:
------------
The properties of the Mysqli object already contain server-info,
server-version, errors, etc., but not the current (selected) database.
It would be great if dbname could be added to mysqli properties.
With the property it gets easier to check if the right database was
selected or if none was selected.

Test script:
---------------
PHP code looks like this:

class mysqli_db extends mysqli {
  public function __construct($host=null, $user=null, $pw=null, $db=null)
{
    call_user_func_array("parent::__construct", func_get_args());
    $this->db = $db;
  }
  // same for real_connect() ...

  public function select_db($db) {
    parent::select_db($db);
    $this->db = $db;
  }
}

$db = new mysqli_db('127.0.0.1', 'root', '', 'test');
echo $db->db; // test

$db->select_db('test2');
echo $db->db; // test2


-- 
Edit bug report at https://bugs.php.net/bug.php?id=63798&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63798&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63798&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63798&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63798&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63798&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63798&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63798&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63798&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63798&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63798&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63798&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63798&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63798&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63798&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63798&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63798&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63798&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63798&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63798&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63798&r=mysqlcfg

Reply via email to