0

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

知道如何解决它吗?

<?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);  
?>  
4

1 回答 1

1

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

于 2012-06-19T06:44:33.163 回答