<bdo id='6bsis'></bdo><ul id='6bsis'></ul>

<i id='6bsis'><tr id='6bsis'><dt id='6bsis'><q id='6bsis'><span id='6bsis'><b id='6bsis'><form id='6bsis'><ins id='6bsis'></ins><ul id='6bsis'></ul><sub id='6bsis'></sub></form><legend id='6bsis'></legend><bdo id='6bsis'><pre id='6bsis'><center id='6bsis'></center></pre></bdo></b><th id='6bsis'></th></span></q></dt></tr></i><div id='6bsis'><tfoot id='6bsis'></tfoot><dl id='6bsis'><fieldset id='6bsis'></fieldset></dl></div>
  • <legend id='6bsis'><style id='6bsis'><dir id='6bsis'><q id='6bsis'></q></dir></style></legend>

        <small id='6bsis'></small><noframes id='6bsis'>

      1. <tfoot id='6bsis'></tfoot>
      2. MS SQL Server 上的 ODBC 查询仅在 PHP PDO (FreeTDS) 中返

        时间:2023-10-04
        <tfoot id='n58Dn'></tfoot>
        <i id='n58Dn'><tr id='n58Dn'><dt id='n58Dn'><q id='n58Dn'><span id='n58Dn'><b id='n58Dn'><form id='n58Dn'><ins id='n58Dn'></ins><ul id='n58Dn'></ul><sub id='n58Dn'></sub></form><legend id='n58Dn'></legend><bdo id='n58Dn'><pre id='n58Dn'><center id='n58Dn'></center></pre></bdo></b><th id='n58Dn'></th></span></q></dt></tr></i><div id='n58Dn'><tfoot id='n58Dn'></tfoot><dl id='n58Dn'><fieldset id='n58Dn'></fieldset></dl></div>
      3. <legend id='n58Dn'><style id='n58Dn'><dir id='n58Dn'><q id='n58Dn'></q></dir></style></legend>

            • <small id='n58Dn'></small><noframes id='n58Dn'>

                  <tbody id='n58Dn'></tbody>

                • <bdo id='n58Dn'></bdo><ul id='n58Dn'></ul>
                  本文介绍了MS SQL Server 上的 ODBC 查询仅在 PHP PDO (FreeTDS) 中返回前 255 个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我目前正在尝试从我们限制从 Linux Web 服务器访问的 SQL Server 数据库视图中提取一些数据.

                  I'm currently trying to pull some data from a SQL Server database view that we have restricted access to from our Linux web server.

                  我们不需要编辑数据,只需将其显示在网页中即可.

                  We don't need to edit the data just display it in a webpage.

                  一切看起来都很好,直到我们尝试输出并且只获取文本字段的前 255 个字符.

                  It all looks fine until we try to output and only get the first 255 characters of a text field.

                  有谁知道这是否是通过 PHP::PDO 使用 FreeTDS 的问题,或者它是否应该可以正常工作?我见过其他人也有类似的问题,但似乎没有多少答案.

                  Does anyone know if this is a problem with using FreeTDS through PHP::PDO or if it should work fine? I've seen other people out there having similar problems, but there don't seem to be many answers.

                  我将其用作 MS SQL 数据库的连接字符串:

                  I'm using this as the connection string for the MS SQL db:

                  $dbConn = new PDO("odbc:Driver=FreeTDS;DSN=OURDSN;UID=WWWUser;PWD=ourpassword");
                  

                  推荐答案

                  根据 FreeTDS 用户指南,问题似乎是 FreeTDS 在与 SQL Server 交谈时只能处理 varchar 最多 255 个字符由于协议定义中固有的限制".任何比这更大的数据类型都需要text.

                  According to the FreeTDS User Guide, the issue seems to be that FreeTDS can only handle varchar up to 255 characters when talking to SQL Server "due to limitations inherent in the protocol definition". Anything bigger than that needs to be data type text.

                  您可以通过相应地修改架构或在查询期间转换数据类型来解决问题,如下所示:

                  You can resolve the issue either by modifying your schema accordingly, or converting the data type during your query, like this:

                  SELECT CAST(mycol as TEXT) FROM mytable
                  

                  这篇关于MS SQL Server 上的 ODBC 查询仅在 PHP PDO (FreeTDS) 中返回前 255 个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 PHP 的 PDO 检查数据库查询返回的结果 下一篇:使用 PDO 回显显示表中的所有行

                  相关文章

                  最新文章

                  <i id='XYWpX'><tr id='XYWpX'><dt id='XYWpX'><q id='XYWpX'><span id='XYWpX'><b id='XYWpX'><form id='XYWpX'><ins id='XYWpX'></ins><ul id='XYWpX'></ul><sub id='XYWpX'></sub></form><legend id='XYWpX'></legend><bdo id='XYWpX'><pre id='XYWpX'><center id='XYWpX'></center></pre></bdo></b><th id='XYWpX'></th></span></q></dt></tr></i><div id='XYWpX'><tfoot id='XYWpX'></tfoot><dl id='XYWpX'><fieldset id='XYWpX'></fieldset></dl></div>
                    <legend id='XYWpX'><style id='XYWpX'><dir id='XYWpX'><q id='XYWpX'></q></dir></style></legend>

                    <small id='XYWpX'></small><noframes id='XYWpX'>

                    • <bdo id='XYWpX'></bdo><ul id='XYWpX'></ul>
                      <tfoot id='XYWpX'></tfoot>