WARNING, this could be a long post as I am going to attempt to put everything in here...
I have searched and still cannot get a resolution for this error relating to using php5 and mssql driver;
PHP Warning: mssql_query() [<a href='function.mssql-query'>function.mssql-query</a>]: message: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier. (severity 16) in <file>
the sql query has been trimmed down to;
select cast((fname + ' ' + lname) as text) as name from user for xml auto
Note that the casting was done due to some reference to ntext not being supported and this was a supposed fix for the error.
and the php code for the call is:
function altLoadData()
{
if(defined('DB_DEBUG') && DB_DEBUG == 1)
error_log(FUNCTION . " Attempting to connect '" . DB_HOSTNAME . "' to use database '" . DB_DATABASE . "'");
if($this->sql_statement == NULL)
{
error_log(FUNCTION . " sql statement is NULL");
return false;
}
$db = mssql_connect(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD);
$d = mssql_select_db(DB_DATABASE, $db);
$res = mssql_query($this->sql_statement, $db);
$row = mssql_fetch_array($res);
$this->sql_result = $row[0];
if(defined('DB_DEBUG') && DB_DEBUG == 1)
error_log(FUNCTION . " RESULT'" . $this->sql_result . "'");
if( !$this->sql_result )
{
if(defined('DB_DEBUG') && DB_DEBUG == 1)
error_log(FUNCTION . " Failed attempting to execute '" . $this->sql_statement . "'");
return false;
}
if(defined('DB_DEBUG') && DB_DEBUG == 1)
error_log(FUNCTION . " SQL result '" . $this->sql_result. "'");
$this->bIsModified = false;
return true;
}
Most notable code is bolded above and now the big question, has anyone ran into this before? I haven't seen many references to php and the FOR XML AUTO stuff out there. As well there seems to be a fix available in Microsoft land (ASP, .net) and java land that is in the connetion string setting selectMethod=direct vs. SelectMethod=cursor. is there a window to be able to do this in php?
thanks in advance for any help as I know this can be a lot to digest