ID:               35823
 User updated by:  carlv at carlsoft dot net
 Reported By:      carlv at carlsoft dot net
 Status:           Open
 Bug Type:         MySQLi related
 Operating System: Windows XP
 PHP Version:      5.1.1
 New Comment:

Sorry, my reproduction code contains a bug (left over when I was taking
out unnecessary code).  Bind result should only have $m_cur_start in it.
 But you get the idea.


Previous Comments:
------------------------------------------------------------------------

[2005-12-27 23:59:59] carlv at carlsoft dot net

Description:
------------
When using a prepared statement, the num_results will return 0  even if
a result is returned.  I am using PHP 5.1 with MySQL 5.

Reproduce code:
---------------
                                $stmt = $mysql->prepare('
                                                                        SELECT
                                                                                
cur_start
                                                                        FROM
                                                                                
track
                                                                        WHERE
                                                                                
id = ?
                                                                                
;');
                                $stmt->bind_param('i',$_GET['id']);
                                $stmt->execute();
                                $stmt->bind_result($m_id,$m_cur_start);
                                $stmt->fetch();
                                // a value is printed out here clearly 
indicating that a row is
returned
                                print $m_cur_start;

                                if ($stmt->num_rows != 1) // this is always 0!
                                {

Expected result:
----------------
$stmt->num_rows should be 1, in this case.

Actual result:
--------------
$stmt->num_rows is always 0.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35823&edit=1

Reply via email to