首頁 > 資料庫 > mysql教程 > ADODB的应用

ADODB的应用

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
發布: 2016-06-01 13:08:12
原創
993 人瀏覽過

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

 ?>

來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板