note 98942 modified in function.mssql-bind by danbrown
| From: | danbrown@php.net | Date: | Fri, 16 Jul 2010 18:45:44 +0000 |
| Subject: | note 98942 modified in function.mssql-bind by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-170922@lists.php.net to get a copy of this message | ||
if you are experiencing difficulties binding an empty string because it is being converted to NULL
by your driver try the following:
<?php
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);
?>
--was--
if you are experiencing difficulties binding an empty string because it is being converted to NULL
by your driver try the following:
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);
http://php.net/manual/en/function.mssql-bind.php