note 98940 rejected from function.mssql-bind by danbrown
| From: | danbrown@php.net | Date: | Fri, 16 Jul 2010 18:14:43 +0000 |
| Subject: | note 98940 rejected from function.mssql-bind by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-170919@lists.php.net to get a copy of this message | ||
Note Submitter: brad at foreverybody dot com
----
there is a bug either in php or in some extention/driver that will convert empty strings
('') to NULL when passed to mssql_bind.
I have developed a work around:
if($var === ''){
//stupid hack to prevent mssql driver from converting empty strings to null. now they arent empty
strings but they will get trimmed down to legth 0 ;-)
$var = ' ';
$type = SQLVARCHAR;
$isNull = false;
$maxLen = 0;
}
mssql_bind($stmt, $param_name, $var, $type, $is_output,$isNull, $maxLen);