From:             [EMAIL PROTECTED]
Operating system: FreeBSD
PHP version:      4.1.2
PHP Bug Type:     Feature/Change Request
Bug description:  Can mysql_select_db return the previously selected db?

Would it be possible for mysql_select_db() to return the previously
selected db on success, and false (as it does already) on failure? That
would make it more useful for times when you want to use another db
temporarily, eg:

function auth() {
    // choose the auth db
    $old_db_name = mysql_select_db('authdb');

    // ... code to authenticate a user here ...

    // change back to whatever was being used before
    mysql_select_db($old_db_name);
    }

I can't see how adding this would break any existing scripts, either, as
the returned value would still have to be true (you can't create databases
called '' in mysql, can you?).

regards,

Peter Lowe.
-- 
Edit bug report at http://bugs.php.net/?id=16495&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16495&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16495&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16495&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16495&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16495&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16495&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16495&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16495&r=submittedtwice

Reply via email to