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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: johnfivealive at hotmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Fri Dec 27 02:01:29 2024 UTC