欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

ADODB的应用

程序员文章站 2023-12-27 11:37:03
...

include_once ('adodb5/adodb.inc.php');

$db = NewADOConnection ('mysql');

$db->Connect("localhost", "root", "", "php100")or die("错误");

$db->Execute("set names 'UTF8'");

$query=$db->execute("select * from `php100`");

while($row=$query->FetchRow()){

print_r($row);

}

?>

include_once ('adodb5/adodb.inc.php');

$db = NewADOConnection ('mysql');

$db->Connect("localhost", "root", "", "php100")or die("错误");

$db->Execute("set names 'UTF8'");

$arr=array(

"name"=>"patzi",

"hit"=>"111"

);

$db->AutoExecute("php100",$arr,"INSERT")

?>

include_once ('adodb5/adodb.inc.php');

$db = NewADOConnection('mysql://root:@localhost/php100');

$db->Execute("set names 'UTF8'");

$sql="select * from `php100`";

$db->SetFetchMode(ADODB_FETCH_ASSOC);

$sr1 = $db->Execute($sql);

print_r($sr1->fields);

$db = NewADOConnection ('mysql');

$db->Connect("localhost", "root", "", "php100")or die("错误");

$db->Execute("set names 'UTF8'");

$query=$db->execute("select * from `php100`");

while($row=$query->fetchnextobject()){

echo $row->NAME;

}

include_once ('adodb5/tohtml.inc.php');

$db = NewADOConnection ('mysql');

$db->Connect("localhost", "root", "", "php100")or die("错误");

$db->Execute("set names 'UTF8'");

$query=$db->execute("select * from `php100`");

echo rs2html($query);

include_once ('adodb5/adodb-pager.inc.php');

session_start();

$db = NewADOConnection('mysql://root:@localhost/php100');

$db->Execute("set names 'UTF8'");

$sql="select * from `php100`";

$pager=new adodb_pager($db,$sql);

$pager->render(3);

?>

上一篇:

下一篇: