doutangguan2460 2009-05-22 05:13
浏览 19
已采纳

PHP和SQL Server - 字段名称被截断

I have discovered that results coming from my SQL Server are having the field names truncated:

$query = "SELECT some_really_really_long_field_name FROM ..."
...
print_r($row);

array(
    'some_really_really_long_field_n' => 'value'
)

Does anyone know how to avoid this behaviour?

I think the database driver is ADODB.

So you don't have to count: the field names are being truncated to 31 characters.

SQL Server doesn't seem to mind the long field names in itself, so I can only presume that there is a char[32] string buffer somewhere in the ADODB driver which can't contain the long names.

  • 写回答

3条回答 默认 最新

  • douping3427 2009-05-22 05:21
    关注

    You're probably using the decade-old, deprecated bundled MSSQL client. Use the new MSSQL driver for PHP from Microsoft or install the MSSQL client tools from your MSSQL server CD.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度