I am currently using SQL Server 2000 Stored Procedures with PHP. Following the PHP doc, I use mssql_bind to assign value of parameters and then execute the Stored Procedure.
The problem is that I got this bug which prevents me to bind empty strings to parameters (they are converted to NULL when the Stored Proc gets called)
I dont’t want to have to convert every parameter inside the Stored Procedures to check if its NULL then convert back to an empty string. I want to be able to use empty strings as well as NULL which both have their own meaning.
Does anyone know a workaround for this in PHP ? PHP bugs website isn’t very clear if that bug is fixed or when it will be fixed, I use PHP 5.2.11 (the lastest version from the 5.2 branch)
Advertisement
Answer
Assuming you do not want to do what you suggested, options left to you are
- Download a cvs snapshot of php and install it if viable, see if it is fixed. If not viable or fixed via cvs then…
- Use system() or exec() calls to use the stored procedures. If too much a hassle then…
- Don’t use stored procedures, do your functionality in php or other scripting code.
- Alter the stored procedure to accept another value for ” strings and convert THAT to a ” string.
- Do what you didn’t want to do. Harsh 😛 But I do not see another way.