php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20359 php returns garbage when no rows selected
Submitted: 2002-11-11 07:03 UTC Modified: 2002-11-12 01:45 UTC
From: pinned at spic dot ru Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.2.3 OS: Solaris 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pinned at spic dot ru
New email:
PHP Version: OS:

 

 [2002-11-11 07:03 UTC] pinned at spic dot ru
Following script does select from empty table and shouldn't return anything. 

<?PHP
$ = @OCIlogon("test", "tst", "db");
unset($body);
$q = "select * from users";
#table "users" is empty, so no rows should be returned
  $newsQ = OCIparse($newsDB, $q);
  $newsRES = OCIexecute($newsQ);
  OCIfetch($newsQ);
  $body = OCIresult($newsQ, 1);
  if($body) {
 #here php prints garbage 
  print $body;
 }
?>

bash-2.03$ ./php test.php
X-Powered-By: PHP/4.2.3
Content-type: text/html

IC27S   ????bash-2.03$

php compiled with the following options:
--without-mysql
--with-oci8
--with-mcrypt
--with-gd
--enable-track-vars
--with-mod_charset
--enable-discard-path

Oracle server version is 8.1.7.4
Client libraries have version 8.1.7.0 




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-11 09:54 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip
 [2002-11-12 01:37 UTC] pinned at spic dot ru
CVS snapshot solved the problem.
No more garbage on output.
Thanks.
 [2002-11-12 01:45 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC