Inserting Unicode characters with PHP -> ODBC -> MS SQL?

前端 未结 3 1951
春和景丽
春和景丽 2021-01-18 17:43

I have the following code:

$sql = \"update tbl_test set category = N\'resumé\';

echo $sql;

$rs=odbc_exec($conn,$sql);

Where $conn is a DS

3条回答
  •  余生分开走
    2021-01-18 18:34

    I would tread carefully here. In the past, when dealing with SQL Server and PHP integration, I have encountered cases where SQL Server uses between 3 and 5 times as much storage space as is actually needed for Unicode characters. Depending on how you connect to the database and how the data is encoded. My understanding is that MSFT is working on a new driver (or it has possibly been out for a while) that addresses the issue and generally improves PHP integration. With some of the older stacks, you might run into trouble. I recommend looking at the data size in the DB to verify that the connection is not padding your data.

    Jacob

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题