#33090 [Asn->Csd]: mysql_prepare doesn't return an error

From: Date: Sat, 21 May 2005 09:36:57 +0000
Subject: #33090 [Asn->Csd]: mysql_prepare doesn't return an error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-79305@lists.php.net to get a copy of this message
ID: 33090 Updated by: andrey@php.net Reported By: georg@php.net -Status: Assigned +Status: Closed Bug Type: MySQLi related Operating System: all PHP Version: 5.0.4 Assigned To: georg New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2005-05-21 10:37:26] georg@php.net Description: ------------ In later versions of libmysqlclient 4.1 and 5.0 the api call mysql_stmt_close also clears mysql->net.error* values. This affects that mysql_prepare doesn't return an error with current version of libmysql. Reproduce code: --------------- <?php $mysql = new mysqli("localhost", "user", "password", "test"); if (!($stmt = $mysql->prepare("this will never work"))) { printf("Error: %s\n", $mysql->error); } $mysql->close(); ?> Expected result: ---------------- Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'this will never work' at line 1 Actual result: -------------- Error: ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33090&edit=1

« previous php.bugs (#79305) next »