ID: 14040 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: ODBC related Operating System: Win 2000 PHP Version: 4.0.6 New Comment:
Thank you for taking the time to report a problem with PHP. Unfortunately your version of PHP is too old -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: ------------------------------------------------------------------------ [2001-11-13 08:44:21] [EMAIL PROTECTED] I've written about 40 php-pages with about 15 classes and everything worked. (Win 2K, Apache, PHP 4.06, Adabas 12). In the last days I've copied some of the classes, put them in a new directory, changed the include directory to include only the new directory (thus no conflict with the old classes). The following error always happened: 1. If I use an exit statement after odbc_exec, then apache will pop-up a "php.exe has generated an error...", in the apache's error log found: "Premature end of script headers: c:/php/php.exe". Then the browser switched to 500 Internal Server Error. 2. The odbc_exec has done (partially?) it's work well. Because if the SQL-Statement is an INSERT one, the entry has been correctly stored in ADABAS. 3. If the exit statement omitted, no error throwed (as in script). All of the exit forms caused crash. 4. My assumption is: the exit statement caused php to cut(end) the thread process. But the odbc statement (thread?) is still running. As the odbc thread come to end, it returns some result to Apache, which can not find the php-process. ---> premature end. I hope you can understand the problem (sorry for my bad english). Greets, B. Rad Script: <? include_once("xpdfConstants.php"); function createContract() { //execute the query $conID = getConnection(); $sql = "SELECT * FROM \"Contract\""; $res = odbc_exec($conID, $sql); // exit; // exit(-1); // exit("ouchh..."); $rNum = odbc_num_rows($res); echo ("<BR>Found $rNum contracts <BR>"); } function getConnection() { global $DEBUG; global $DB_host, $DB_user, $DB_password; if (!($connectionID = odbc_connect ($DB_host,$DB_user, $DB_password))) { printError(0, "can not create a connection to $DB_SERVER", "authenticateUser"); return -1 ; } return $connectionID; } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=14040&edit=1
