那不应该啊, 你加下,
header("Content-Type: text/html;
这个试试
建议你换PDO试试,PDO是PHP数据对象的扩展,通过特定驱动可以支持几乎所有的数据库,其中包括用pdo_odbc来连接操作mssql或access等.
本文实例讲述了PHP使用ODBC连接数据库的方法.分享给大家供大家参考.具体实现方法如下:
!DOCTYPE
html
PUBLIC
XHTML
①0
Strict//EN"
""
xmlns=""
xml:lang="en"
lang="en"
head
titlePHP
and
ODBC:
Example
①./title
meta
http-equiv="Content-Type"
content="text/html;
/
/head
body
php
$conn
=
odbc_connect(
"DRIVER={MySQL
ODBC
Driver};Server=localhost;Database=phpodbcdb",
"username",
"password");
if
(!($conn))
{
echo
"pConnection
to
DB
via
failed:
";
odbc_errormsg
($conn
);
"/p\n";
}
$sql
"SELECT
as
test";
$rs
odbc_exec($conn,$sql);
"tabletr";
"thTest/th/tr";
while
(odbc_fetch_row($rs))
$result
odbc_result($rs,"test");
"trtd$result/td/tr";
odbc_close($conn);
"/table";
/body
/html
希望本文所述对大家的php程序设计有所帮助.
以上就是土嘎嘎小编为大家整理的包含odbc與php的词条相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!