zoukankan      html  css  js  c++  java
  • ADODB的应用

    <?php

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

    <?php

    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") 
    ?>

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

  • 相关阅读:
    图论一角
    入门-k8s部署应用 (三)
    入门-k8s集群环境搭建(二)
    入门-Kubernetes概述 (一)
    shell中获取时间
    Linux shell脚本之 if条件判断 (转)
    linux中shell变量$#等的释义
    shell 的here document 用法 (cat << EOF) (转)
    Homebrew的安装与使用
    docker容器编排 (4)
  • 原文地址:https://www.cnblogs.com/smartyman/p/3798431.html
Copyright © 2011-2022 走看看