freebsd php5.3 pdo_odbc 查询 sql server varchar类型 text类型不显示
本帖最后由 jingyanlei 于 2013-08-21 14:42:55 编辑
varchar不能大于255 text直接不显示,php换了几个版本都一样,在win环境下查询正常
代码:
$conn = new PDO("odbc:s_test_33", 'sa', 'sa');
$conn->setAttribute(PDO::ATTR_CASE, PDO::CASE_UPPER);
$conn->query('SET TEXTSIZE 3145728');
//查询数据
$sql = 'select top 6 * from dbo.b1';
//$stmt = $conn->query($sql);
$stmt = $conn->prepare($sql);
$stmt->execute();
var_dump($stmt);
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($result);
错误:
Array
(
[0] => SL009
[1] => 0
[2] => [unixODBC][Driver Manager]No columns were bound prior to calling SQLFetch or SQLFetchScroll (SQLFetchScroll[0] at /usr/ports/databases/php53-pdo_odbc/work/php-5.3.27/ext/pdo_odbc/odbc_stmt.c:537)
[3] => SL009
)
------解决方案--------------------这个问题好解决。我私下告诉你