Doc #60191 [NEW]: wrong result
| From: | j dot veder at advanceu dot nl | Date: | Tue, 01 Nov 2011 13:25:39 +0000 |
| Subject: | Doc #60191 [NEW]: wrong result | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-7368@lists.php.net to get a copy of this message | ||
From:
Operating system: windows
PHP version: Irrelevant
Package: *General Issues
Bug Type: Documentation Problem
Bug description:wrong result
Description:
------------
---
From manual page:
http://www.php.net/function.mysql-query#refsect1-function.mysql-query-examples
---
<?php
$result = mysql_query('SELECT * WHERE 1=1');
if (!$result) {//this does not return false ever!!!!!!!!! returns on fail:
'result resource(7)' after mysql_fetch_assoc() returns bool(false)
die('Invalid query: ' . mysql_error());
}
?>
Test script:
---------------
<?php
$result = mysql_query('SELECT * WHERE 1=1');
print_r($result);
if (!$result) {
die('Invalid query: ' . mysql_error());
}
?>
Expected result:
----------------
false
Actual result:
--------------
result resource(7)
--
Edit bug report at https://bugs.php.net/bug.php?id=60191&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60191&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60191&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60191&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60191&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60191&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60191&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60191&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60191&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60191&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60191&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60191&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60191&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60191&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60191&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60191&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60191&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60191&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60191&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60191&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60191&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60191&r=mysqlcfg