PHP mssql_connect正在截断特殊字符

时间:2015-03-17 20:17:41

标签: php sql-server

PHP mssql_connect正在截断短划线,短划线,重音字母和其他特殊字符以及之后出现的文本。

例如:

  

在MSSQL中:3 - 5年级   成为:3年级

也...

  

在MSSQL中:Sí和Sí   成为:S

代码详述如下。

ini_set('mssql.charset', 'UTF-8');
$link = mssql_connect($server, $user, $passwd);
$returnrows = mssql_query($query_string, $link);
while ($row = mssql_fetch_array($returnrows)) {
    variable = $row['row_name';
}

下面提供的query_string

$query_string = 
"SELECT [Internal ID] as internalid
,[SKU] as sku
,[Title Name] as name
,CAST([Title Description] AS TEXT) as description
, ". "[SLP] as price
,[SLP Canada] ascanadaprice,CAST([Subtitle]AS TEXT) as subtitle
, ". "[Author] as author
,CAST([Narrator] AS TEXT) as narrator
,[Translator] as translator
,[Series] as series,[ISBN] as isbn
, ". "[Publisher] as publisher
,[Publisher Street Date] as publisher_street_date
,[Launch Date] as launch_date
,[Release Type] as releasetype
,[Primary Genre] as primarygenre
, ". "[Secondary Genre] as secondarygenre
,[Grade Level] as grade_level
,[Abridgement] as abridgement
,[Duration] duration
,[Awards] as awards
,[Language] as language
, ". "[Active] as active
, [NYT] as nyt
, CAST([Sales Rights Locations] AS TEXT) as sales_territory_rights
,[Sales Rights Locations Exclusions] as sales_territory_exclusions
, ". "[Fiction / Non-Fiction] as fiction ". "
FROM dbWebsites.dbo.tblBooks 
WHERE [Pack]='No' ";
if ($argv[1] != 'ALL') {
$query_string = $query_string . " and [Last Modified Date]>'" .
$start_datetime . "' and [Last Modified Date]<='" . $end_datetime . "' ";
}
$query_string = $query_string . " ORDER BY internalid ASC ";

0 个答案:

没有答案