直接打开php.ini,去掉注释即可
extension=odbc
其他扩展
)$server_name = "xxxxxxxx"; # 你的Sql Server 服务器IP
$database_name = "apk";
$username = "test";
$password = "123456";
$conn = odbc_connect("Driver={SQL Server};Server=$server_name;Database=apk;", $username, $password);
if (!$conn) {
die("连接失败: " . odbc_errormsg());
}
ini_set('odbc.defaultlrl', 2000000); # 设置读取列长度
$sql = "select * from info_Catalog";
$result = odbc_exec($conn, $sql);
while ($row = odbc_fetch_array($result)) {
echo "<pre>";
print_r($row);
die;
}
ini_set('odbc.defaultlrl', 2000000); # 设置长度,当然你也可以直接修改php.ini,重启php服务永久生效
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有