|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-03 14:40 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
Description: ------------ After exection of query where mysql returns an empty set then 'if($result)' returns true.It should return false.How to handle this situation. Reproduce code: --------------- --- From manual page: function.mysql-fetch-row#Examples --- $query="select name from user where id=42'"; $result=mysql_query($query); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } $data = MYSQL_RESULT($result,0,"id"); Expected result: ---------------- Could not run query : No such row in database. Actual result: -------------- Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 4 in C:\wamp\www\all is well\signin.php on line 6