⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pdo.php

📁 php聊天源码
💻 PHP
字号:
<?php
error_reporting(E_ALL);
include('../adodb.inc.php');



echo "New Connection\n";
$DB = NewADOConnection('pdo');
echo "Connect\n";
$pdo_connection_string = 'odbc:nwind';
$DB->Connect($pdo_connection_string,'','') || die("CONNECT FAILED");
echo "Execute\n";



//$ADODB_FETCH_MODE = ADODB_FETCH_ASSOC;
$rs = $DB->Execute("select * from products where productid<3");
echo "e=".$DB->ErrorNo() . " ".($DB->ErrorMsg())."\n";


//print_r(get_class_methods($DB->_stmt));

if (!$rs) die("NO RS");
echo "FETCH\n";
$cnt = 0;
while (!$rs->EOF) {
	print_r($rs->fields);
	$rs->MoveNext();
	if ($cnt++ > 1000) break;
}

echo "<br>--------------------------------------------------------<br>\n\n\n";

$stmt = $DB->PrepareStmt("select * from products");
$rs = $stmt->Execute();
echo "e=".$stmt->ErrorNo() . " ".($stmt->ErrorMsg())."\n";
while ($arr = $rs->FetchRow()) {
	print_r($arr);
}
die("DONE\n");

?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -