首页 >数据库 >mysql教程 >ADODB的应用

ADODB的应用

WBOY
WBOY原创
2016-06-01 13:08:12950浏览

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);

 ?>

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn