php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29057 PHP doesn't generate a warning on mysql_select_db failure
Submitted: 2004-07-08 05:17 UTC Modified: 2004-07-08 09:03 UTC
From: johnfivealive at hotmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.0.0RC3 OS: Fedora Core 2
Private report: No CVE-ID: None
 [2004-07-08 05:17 UTC] johnfivealive at hotmail dot com
Description:
------------
whenever mysql_select_db returns false PHP should output a warning message to the browser if php is configured to do so. As it stands now when mysql_select_db fails, PHP generates no warning on failure. This is not consistent with other PHP mysql_* functions.

Reproduce code:
---------------
Make sure all warnings are enabled in php.ini

psuedo code:

$connection = mysql_connect( "host", "user", "pass" );

mysql_select_db( "some non existent DB", $connection );

mysql_select_db should return false, but no warning is generated

Expected result:
----------------
a warning should be outputed to the browser

Actual result:
--------------
function returns correctly, but no warning is outputted

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-08 09:03 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

If it returns false, you can much more easily check for it without having to obfucsicate the functioncall with the shut-up operator (@). No way this is going to be changed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 09:01:26 2024 UTC