|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-11-10 12:53 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 23:00:01 2025 UTC |
Description: ------------ when doing a mysql_num_rows, if there are no matching rows it gives an error instead of returning 0. Reproduce code: --------------- $Query = "SELECT * FROM MyTable WHERE Field1 = '1' and Field2 = '2' "; $Result = mysql_query($Query) or die("Error101: ". mysql_error()."<BR>".$Query); $CNT = mysql_num_rows($Result) OR DIE("Error 102: "."<BR>".mysql_error()."<BR>".$Query."<BR>"); echo "There are ".$CNT." matching results. "; Expected result: ---------------- $CNT should be set to '0' and page should display "There are 0 matching results." Actual result: -------------- Error 102: SELECT * FROM MyTable WHERE Field1 = '1' and Field2 = '2'