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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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-2023 The PHP Group
All rights reserved.
Last updated: Sat Jun 03 19:03:38 2023 UTC