I write SQL query and execute query work but this query add in PHP code does not work.
$query=" SELECT k_name, count(*) from k_table left join (SELECT Split.a.value('.', 'VARCHAR(100)') AS String FROM (SELECT [k_id], CAST ('<M>' + REPLACE([k_id], ',', '</M><M>') + '</M>' AS XML) AS String FROM t_table) AS A CROSS APPLY String.nodes ('/M') AS Split(a))n on n.String=k_table.id group by k_name order by count(*) ";
$result = mssql_query($query);
$numresult = mssql_num_rows($result);
Give this error
Error (mssql_query): SELECT failed because the following SET options have incorrect settings: 'ANSI_NULLS, QUOTED_IDENTIFIER, CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING, ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.