php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52027 NULL bytes in mysqli prepared statements
Submitted: 2010-06-09 11:22 UTC Modified: 2010-06-09 15:58 UTC
From: jamie at splooshmedia dot co dot uk Assigned:
Status: Not a bug Package: PHP-GTK related
PHP Version: Irrelevant OS: Windows 7
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: jamie at splooshmedia dot co dot uk
New email:
PHP Version: OS:

 

 [2010-06-09 11:22 UTC] jamie at splooshmedia dot co dot uk
Description:
------------
MySQLi prepared statements always return NULL bytes when running in PHP-GTK. This bug does not exist in WAMP environment. Normal queries work fine in PHP-GTK. My PHP-GTK/MySQL setup is fine.

Test script:
---------------
$test = null;
if($stmt = $mysqli->prepare("SELECT 'here 3' FROM saved_data LIMIT 1")) {	
	echo 'here 1';
	$stmt->bind_result($test);	
	$stmt->execute();
	while($stmt->fetch()) {
                echo 'here 2';
		var_dump($test);
	}
}

Expected result:
----------------
here 1
here 2
string(6) "here 3"

Actual result:
--------------
here 1
here 2
string(7) "       "

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-09 15:12 UTC] auroraeosrose@php.net
-Status: Open +Status: Bogus
 [2010-06-09 15:12 UTC] auroraeosrose@php.net
Cannot reproduce - works perfectly here

check that you do not have the wrong libmysql being loaded (not php_mysqli.dll - but the libmysql.dll that it uses - this sounds like a client mismatch)
 [2010-06-09 15:22 UTC] auroraeosrose@php.net
BTW - some additional debugging suggestions for your setup - testing against WAMP is irrelevant, it's a different PHP executable in a different location with different extensions and loading different dependencies

Try your mysqli on your php-gtk install, just comment out the php-gtk extension, and see if you still get the errors
 [2010-06-09 15:58 UTC] jamie at splooshmedia dot co dot uk
Thanks for your help. After getting mysql dll files from PHP 5.2.13NTS and copying them into PHP-GTK the problem has gone.. Must have been a version mismatch as you say! Strange that some functionality worked but not all.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 14:01:24 2020 UTC