php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6840 echo and print stops outputting after getting an NULL (from an oci8 query)
Submitted: 2000-09-21 20:59 UTC Modified: 2000-10-28 23:33 UTC
From: anders at gatefive dot fi Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.2 OS: Linux 2.2.10, (SuSE 6.2)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 - 22 = ?
Subscribe to this entry?

 
 [2000-09-21 20:59 UTC] anders at gatefive dot fi
/*
After searching for an error for hours I came to the conclusion it is in 
echo *and* print, but not in printf. Also, a flush(); will help somewhat after
the problematic echo line  > echo(sprintf(", %s(%s) = %s(%s)", ...); flush();
allthough everything after the 4th %s will be gone., 4th being most likely
a string being null */

/* Form here OK all way to: */
include("forms/header");  // HTML head & title & meta & body tags
   OCIInternalDebug(1);

   $conn = OCIPLogon(SQL_USER, SQL_PASS, SQL_HOST);
   $sql_str  = "select * from kaupungit";

   if (!$conn) {
      echo "Error connection, exiting";
      exit;
   }
   
   $result = OCIParse($conn, $sql_str);
   echo_d("<!-- sql_str: $sql_str, q: $result -->\n");
   $success = OCIExecute($result, OCI_COMMIT_ON_SUCCESS);

// $success = 1;
   if ($success) {
//   $numrows = OCIFetchStatement($result, &$row);
     
//   OCIFetchInto($result,&$row,OCI_ASSOC+OCI_RETURN_NULLS);
      OCIFetchInto($result,&$row);
//   OCIFetch($result);
   
      $err = OCIError($result);
      if (is_array($err))
        echo($err['code']."=".$err['message']."<br>\n");
      
      echo("YEAH(type=".gettype($row));
   
      if (isset($numrows)) 
        echo(", rows=$numrows");
   
      if (is_array($row)) {
         while (list($key, $val) = each($row)) {
/* here.. line below stops all output, was tried with sprintf and without */
            echo(sprintf(", %s(%s) = %s(%s)", 
                         gettype($key), $key,
                         gettype($val), $val)); /* Specificly the value of $val breaks echo */
            if (is_array($val)) {
               echo("(".count($val).")");
               echo("[".$val[0]."]");
               while (list($key2, $val2) = each($val)) {
                  echo("<br>--&gt;$key2=$val2");
               }
            }
         }
      }
      echo(")<br>\n");
   } else {
      echo("PUKE<br>\n");
   }

/* !!!! the HTML text included below *will* be displayed */
  include("forms/footer"); 

compiletime options:
./configure                         \
--with-config-file-path=/etc/httpd  \
--enable-sigchild                   \
--with-gnu-ld                       \
--enable-yp                         \
--with-swf=/usr/local/lib/swf       \
--with-snmp                         \
--enable-ftp                        \
--enable-calendar                   \
--with-pgsql=/usr/lib/pgsql         \
--with-mysql=yes                    \
--enable-safe-mode                  \
--enable-sysvsem                    \
--enable-sysvshm                    \
--enable-track-vars                 \
--enable-magic-quotes               \
--enable-memory-limit               \
--enable-debugger                   \
--enable-bcmath                     \
--with-zlib=yes                     \
--with-ttf                          \
--with-ldap=yes                     \
--with-xml                          \
--with-gd=yes                       \
--with-yp                           \
--with-jpeg-dir                     \
--with-tiff-dir                     \
--with-config-file-path=/etc/httpd  \
--with-apxs=/usr/sbin/apxs          \
--with-exec-dir=/usr/lib/apache/bin \
--enable-bcmath                     \
--enable-dbase                      \
--enable-filepro                    \
--with-mcrypt=/usr/local            \
--with-oracle                       \
--with-xpm-dir=/usr/X11R6           \
--with-oci8                         \
--with-curl                         \
--with-imap=yes                     \
--with-mhash                        \
--enable-versioning                 \
--with-t1lib


Oracle 8.0.5 is on a Windows NT machine.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-25 18:56 UTC] stas@php.net
Is this reproduceable without Oracle involved? If yes, please provide short reproducing script...
 [2000-10-28 23:33 UTC] sniper@php.net
No feedback. Please update to PHP4.0.3pl1. 
Reopen this bug report if problem still exists. 

--Jani
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 11:01:25 2019 UTC