|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-12-28 00:01 UTC] carlv at carlsoft dot net
[2005-12-28 11:57 UTC] sniper@php.net
[2005-12-28 12:14 UTC] georg@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 03:00:02 2025 UTC |
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.