php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51029 PHP does not display any error message on operations on non-existant database
Submitted: 2010-02-12 19:53 UTC Modified: 2013-02-18 00:34 UTC
From: ahmetsinan at gmail dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 5.2SVN-2010-02-12 (SVN) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
46 - 33 = ?
Subscribe to this entry?

 
 [2010-02-12 19:53 UTC] ahmetsinan at gmail dot com
Description:
------------
PHP does not displays any error messages, while inserting to a non-existant table in non-existant database and creating a table in non-existant database. Displaying the errors is on.

Reproduce code:
---------------
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("sthnonexistant", $con);
$sql = "CREATE TABLE IF NOT EXISTS `registration` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ;";

mysql_query($sql,$con);

Expected result:
----------------
An error message, containing that database does not exist.

Actual result:
--------------
Success message.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-12 21:51 UTC] jani@php.net
Exactly what PHP version are you using? 
 [2010-02-20 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2010-04-25 20:04 UTC] felipe@php.net
-Status: No Feedback +Status: Feedback
 [2010-04-25 20:04 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC