[PHP-DEV] PHP 4.0 Bug #6840: echo and print stops outputting after getting an NULL (from an oci8 query) From: anders <email protected>
Date: 09/21/00

From: anders <email protected>
Operating system: Linux 2.2.10, (SuSE 6.2)
PHP version: 4.0.2
PHP Bug Type: *Function Specific
Bug description: echo and print stops outputting after getting an NULL (from an oci8 query)

/*
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.

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>