[freetds] Issue sending xml to a mssql-2k stored proc using php5 (php4 work s)

Leonard, Carl cleonard at whisolutions.com
Tue May 6 17:49:28 EDT 2008

I've got a problem sending a XML parameter to a MSSQL stroed proc using php5
and freetds 0.63.  This came up during testing for a move from php4 to php5.
It works fine under php4.  I'm using mssql_query in php not the more proper
mssql_execute.  It is only the XML field that is causing the issue.

A sample code fragment 

$SQL = "exec stored_proc_name NULL, NULL,
'<status><id>5</id><id>6</id><id>8</id></status>', NULL, '01/01/2001',
'04/29/2008', 25, 1";
$rc = mssql_query($sSQL,$Link_ID);

This bombs with with php5, but works just fine using tsql or php4.  The
error is a syntax error. (Incorrect syntax near ','.)

Wondering what should be tried next.  The newer release .64 causes problems
with blank text fields so I can't really use that.  Should I give one of the
release candidates a try?  I've been waiting for the actual released

I've turned on the Freetds logs and I can't hardly find a difference between
the tsql case and the php5 case.  About the only significant difference is
that tsql connects with "TDS-library" and php5 connects with "DB-library."

More information about the FreeTDS mailing list