PHP 4.0 Bug #3035: odbc_prepare causes crash
| From: | alexp at semaphore dot com | Date: | Fri, 24 Dec 1999 01:50:50 +0000 |
| Subject: | PHP 4.0 Bug #3035: odbc_prepare causes crash | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-13979@lists.php.net to get a copy of this message | ||
From: alexp@semaphore.com
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.