[PHP-DEV] PHP 4.0 Bug #3035: odbc_prepare causes crash From: alexp <email protected>
Date: 12/23/99

From: alexp <email protected>
Operating system: AIX version 4.3.2
PHP version: 4.0 Beta 3
PHP Bug Type: Reproduceable crash
Bug description: odbc_prepare causes crash

php configured as apache module. Apache ver. 1.3.9. DB2 version 6.1

./configure --with-apache=<apache dir> --with-ibm-db2=<db2 dir>

The httpd.conf file has the following additions

php_flag track_errors on
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

The error occurs when I used the odbc_prepare function
like this:

$connection = odbc_pconnec("db","username","password");
$stmt = odbc_prepare($connection,"SELECT * FROM NON_EXISTENT_TABLE");
odbc_execute($stmt,&$row);
echo "data=".current($row);

Since the table I am querying from doesn't exist it should return an error, but it doesn't. It does one of two things kind of randomly. It will either cause the browser to display -> server returned an invalid or unrecongnized response. Or it won't display any error message and then when you try to execute the statement it will say :

Warning: No array passed to odbc_execute() in /home/httpd/htdocs/development/test.php on line 7

Warning: Variable passed to current() is not an array or object in /home/httpd/htdocs/development/test.php on line 8

And it does each one pretty randomly. If I hit the refresh button over and over each time might return either output. If I put that code in a function and then call the function it gives me the - server returned invalid or unrecognized or invalid response error every time though.

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