#19497 [NEW]: odbc_num_rows gives -1 if I do not use ORDER BY
| From: | bcardoso at ccg dot pt | Date: | Thu, 19 Sep 2002 11:21:25 +0000 |
| Subject: | #19497 [NEW]: odbc_num_rows gives -1 if I do not use ORDER BY | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-19736@lists.php.net to get a copy of this message | ||
From: bcardoso@ccg.pt
Operating system: Windows .Net Standard Server RC1
PHP version: 4.2.2
PHP Bug Type: ODBC related
Bug description: odbc_num_rows gives -1 if I do not use ORDER BY
When using the same code in 2 pages (only the query is different), I
checked that odbc_num_rows gives -1 in one of them (the other is ok).
I check the SQL statement, and I conclude:
- if I use ORDER BY (SELECT .. FROM ... ORDER BY ...) the function
odbc_num_rows gives me the right number;
- if I remove the ORDER BY (SELECT .. FROM ...), the odbc_num_rows gives
-1
code:
$sql=("SELECT id,term FROM dict WHERE state IN (0,1) ORDER BY term");
$result=odbc_exec($db,$sql);
...
if (odbc_num_rows($result)==0)
...
--
Edit bug report at http://bugs.php.net/?id=19497&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19497&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19497&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19497&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19497&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19497&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19497&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19497&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19497&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19497&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19497&r=globals