Home > Backend Development > PHP Tutorial > pdo odbc与sql2000的操作解决方法

pdo odbc与sql2000的操作解决方法

WBOY
Release: 2016-06-13 11:15:45
Original
1114 people have browsed it

pdo odbc与sql2000的操作
我的php版本5.3.8,所以没了mssql等dll,能用的只有pdo odbc,此乃前提
try{
 $conn = new PDO("odbc:Driver={SQL Server};Server=192.168.1.1,1433;Database=master;",'sa','xuxin');
}catch(Exception $e){
 //echo "Failed: " . $e->getMessage();
 echo 'Can not connect to database!';
 die();
}
try了下,貌似能连上,修改密码神马的就会显示Can not connect to database!,顺带鄙视下端口号为毛是,。
关键问题是,我想执行个查询或者删除,sql语句如何弄呢?
对这个实在不懂
请赐教,我用这样的方法,
$sth = $pdo->prepare("select piID from CFWorkTtems");
$sth->execute();
//将整个记录集读到数组里:
$result = $pdo->fetchAll();
var_dump($result);
print_r($result);
显示Fatal error: Call to undefined method PDO::fetchAll()

sql database php
------解决方案--------------------
$result = $sth->fetchAll();
------解决方案--------------------
输出空数组表示检索成功,但没有检索到内容
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template