php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46221 bind_param and wrong result
Submitted: 2008-10-02 18:25 UTC Modified: 2008-11-21 13:34 UTC
Votes:6
Avg. Score:4.8 ± 0.4
Reproduced:3 of 3 (100.0%)
Same Version:4 (133.3%)
Same OS:4 (133.3%)
From: dzyszla at dzyszla dot aplus dot pl Assigned:
Status: No Feedback Package: MySQLi related
PHP Version: 5.2.6 OS: Linux (CentOS 5.2)
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: dzyszla at dzyszla dot aplus dot pl
New email:
PHP Version: OS:

 

 [2008-10-02 18:25 UTC] dzyszla at dzyszla dot aplus dot pl
Description:
------------
My webserver provider changed the mysqli module to the newest version (I don't wont, what number). And my code with mysqli_stmt_bind_param dosen't work correctly, but i get no error message (by mysqli_stmt_error after each command too). I do something wrong?

Reproduce code:
---------------
$stmt=mysqli_stmt_init($sql);
  if(mysqli_stmt_prepare($stmt,'SELECT COUNT(*) FROM posts WHERE 
`parent`=?'))
  {
   $parent=1;

   if (mysqli_stmt_bind_param($stmt,'i',$parent)) echo 'OK'; else echo 'FALSE';
   if (mysqli_stmt_bind_result($stmt,$enters)) echo 'OK'; else echo 'FALSE';

   if(mysqli_stmt_execute($stmt)) echo 'OK'; else echo 'FALSE';
   if (mysqli_stmt_fetch($stmt)) echo 'OK'; else echo 'FALSE';

   echo $enters;
  }
  mysqli_stmt_close($stmt);


Expected result:
----------------
OKOKOKOK0

Actual result:
--------------
OKOKOKOK161

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-02 18:28 UTC] dzyszla at dzyszla dot aplus dot pl
sorry, I replaced expected and actual result above. Now is: OKOKOKOK0, and I expect: OKOKOKOK161
 [2008-10-02 19:50 UTC] dzyszla at dzyszla dot aplus dot pl
(updated information about OS)
(one more correct: I wrote: "don't wont", of course will be: "don't know" ;) eh, my language...)
bind_result work 100% good. Before update this script work correctly.
 [2008-10-26 17:49 UTC] felipe@php.net
Please try using this CVS snapshot:

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

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

I can't reproduce it.
 [2008-10-27 19:12 UTC] dzyszla at dzyszla dot aplus dot pl
Because problem is on public server, my web service provider sad, that can't test any unofficial version. :(
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 10:01:29 2024 UTC