#51029 [Opn->Fbk]: PHP does not display any error message on operations on non-existant database

From: Date: Fri, 12 Feb 2010 21:51:31 +0000
Subject: #51029 [Opn->Fbk]: PHP does not display any error message on operations on non-existant database
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147530@lists.php.net to get a copy of this message
ID: 51029 Updated by: jani@php.net Reported By: ahmetsinan at gmail dot com -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: Linux PHP Version: 5.2SVN-2010-02-12 (SVN) New Comment: Exactly what PHP version are you using? Previous Comments: ------------------------------------------------------------------------ [2010-02-12 19:53:34] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=51029&edit=1

« previous php.bugs (#147530) next »