php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33090 mysql_prepare doesn't return an error
Submitted: 2005-05-21 10:37 UTC Modified: 2005-05-21 11:36 UTC
From: georg@php.net Assigned: georg (profile)
Status: Closed Package: MySQLi related
PHP Version: 5.0.4 OS: all
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: georg@php.net
New email:
PHP Version: OS:

 

 [2005-05-21 10:37 UTC] 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: 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-21 11:36 UTC] andrey@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC