note 51993 deleted from function.mssql-bind by didou
| From: | didou@php.net | Date: | Sun, 04 Feb 2007 05:40:06 +0000 |
| Subject: | note 51993 deleted from function.mssql-bind by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122786@lists.php.net to get a copy of this message | ||
Note Submitter: tim at howarth dot uk dot com
----
The behavior appears to be different on windows (using
dbnetlib) and linux (using freetds)
On windows, one could miss out the optional parameters.
On linux, the optional parameters aparently need to be
supplied (or at least I got spurious errors)
which stopped when I added them!
I was using XAMPP (which gives me apache, php5, and
freetds in one easy shot!) on FC3.
Code example:
$cn = mssql_connect($DBSERVER, $DBUSER, $DBPASS);
mssql_select_db($DB,$cn);
$sp=mssql_init("WDumpAdd"); // stored proc name
mssql_bind($sp, "@productname",
stripslashes($newproduct),
SQLVARCHAR,FALSE,FALSE,150);
mssql_bind($sp, "@quantity",
stripslashes($newquantity),
SQLVARCHAR,FALSE,FALSE,50);
mssql_execute($sp) or die("could not perform insert");
mssql_close($cn);
hope this helps
Tim