PHP 4.0 Bug #5458 Updated: odbc_prepare crashes calling MSSQL stored procedures
| From: | waldschrott@php.net | Date: | Thu, 09 Nov 2000 17:37:24 +0000 |
| Subject: | PHP 4.0 Bug #5458 Updated: odbc_prepare crashes calling MSSQL stored procedures | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-37596@lists.php.net to get a copy of this message | ||
ID: 5458
Updated by: waldschrott
Reported By: santiago.holgado@telesoft.es
Status: Closed
Bug Type: ODBC related
Assigned To:
Comments:
no feedback
Previous Comments:
---------------------------------------------------------------------------
[2000-10-22 05:38:41] dbeu@php.net
does the problem still exist with 4.0.3pl1?
---------------------------------------------------------------------------
[2000-07-08 14:09:33] santiago.holgado@telesoft.es
PHP 4.0.1pl2 Win32 CGI (the one in php.net) under IIS4
I'm using ODBC support to access MS SQL Server databases by querying stored procedures. The way
to call those is the next one:
{CALL sp(param1, param2)}
written into {}. The following code (and similar calls) worked in PHP 3.0.16, but now the following
sentence
if (($Resultset = odbc_prepare($Conexion, "{CALL chkUserName(?)}")) == false) {
die("Error");
}
ends with a Fatal: emalloc()
Replacing ? with a parameter works fine.
I will also point that the automatic parameter binding done in odbc_execute, causes that I
can't return values using parameters
{? = CALL sp(?,?)}
This is a valid SQL Server sentence which allows returning a code, and it's done by binding a
parameter using OUTPUT or RETURN instead of INPUT. I remember also that the parameter binding done
only binded strings (that was PHP 3.0.16)
As pointed in another bug, I'll recomend adding a odbc_bindparameter function with 4 params:
prepared statement, argument, sql data type, input/output. Parameter order can be checked with
Microsoft documentation.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=5458