[PHP-DEV] PHP 4.0 Bug #4613: track_errors & display_errors ignored From: s.p.turvey <email protected>
Date: 05/26/00

From: s.p.turvey <email protected>
Operating system: Win2K + Apache
PHP version: 4.0.0 Release
PHP Bug Type: Scripting Engine problem
Bug description: track_errors & display_errors ignored

The following code does not work as expected:

<?
  include ("std_header.php");

  $dbConnection = mysql_connect ('localhost', 'webuser', 'somewrongpassword') or mysql_die ($php_errormsg);
        
  mysql_close ($dbConnection);
  
  include ("std_footer.php");

  function mysql_die ($error) {
    echo "<TABLE WIDTH=\"50%\" BORDER=\"1\">";
    echo "<TR><TD>";
    echo "An error occured, please forward the details below to the ";
    echo "<A HREF=\"mailto:s.p.turvey <email protected>\">site administrator</A>";
    echo " so that the fault may be rectified - thank you.";
    echo "</TD></TR>";
    echo "<TR><TD>";
    echo $error;
    echo "</TD></TR>";
    echo "</TABLE>";

    echo "<BR><A HREF=\"javascript:history.go(-1)\">Return to previous page</A>";
    include ("std_footer.php");
        
    exit;
  }
?>

track_errors is On
display_errors is Off

I expected this to suppress the automatic display of errors from mysql_connect (it doesn't) and put the actual error message in $php_errormsg (it doesn't).

While we're on the topic. mysql.errno and mysql.error functions also return nothing following error.

This is with Win25, PHP4.0.0 Release, Apache 1.3.12, and MySQL 3.22.34

-- 
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>