mssql php 无法选择字段类型 nvarchar(MAX) [英] mssql php can't select field type nvarchar(MAX)

查看:35
本文介绍了mssql php 无法选择字段类型 nvarchar(MAX)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此代码从 sql server 2012 db 中选择密码字段,并且不返回任何数据我尝试更改字段类型并且它确实有效实际上我无法更改主服务器中的字段类型,我需要按原样使用它

I use this code to select password field from the sql server 2012 db, and does not return any data I tried to change the field type and it did work actually I can't change the field type in the main server and I need to work with it as it is

知道如何解决这个问题吗?

any idea how to work around it?

<?php
$objConnect = mssql_connect("localhost:1434\MSSQLSERVER","fdi","fdifdi");

if($objConnect)  
{  
echo "Database Connected.<br />";  
mssql_select_db('Intranett', $objConnect);
$query = mssql_query('SELECT  [pass] FROM [Intranett].[dbo].[v24Brukere]');

// Check if there were any records
if (!mssql_num_rows($query)) {
    echo 'No records found';
} else {
    // Print a nice list of users in the format of:
    // * name (username)

    echo '<ul>';

    while ($row = mssql_fetch_object($query)) {
        echo '<li>' . $row->pass .' </li>';
    }

    echo '</ul>';
}

}  
else  
{  
echo "Database Connect Failed.<br />";  
echo mssql_get_last_message();
}  

mssql_close($objConnect);  
?>  

推荐答案

据我所知,旧的和过时的 mssql 驱动程序不支持 NVARCHAR.您应该改用 Microsoft 的用于 PHP 的 SQL Server 驱动程序.

As far as I know, NVARCHAR is not supported with the old and long outdated mssql-drivers. You should instead use Microsoft's SQL Server Driver for PHP.

这篇关于mssql php 无法选择字段类型 nvarchar(MAX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆