Home > Database > Mysql Tutorial > ADODB的应用

ADODB的应用

WBOY
Release: 2016-06-01 13:08:12
Original
953 people have browsed it

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

 ?>

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