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

  • 相关阅读:
    带箭头提示框
    文本溢出显示省略号
    Git高级操作
    sublime text 2 破解
    python如何画三维图像?
    pytorch梯度下降法讲解(非常详细)
    pytorch数学运算与统计属性入门(非常易懂)
    pytorch张量数据索引切片与维度变换操作大全(非常全)
    pytorch中tensor张量数据基础入门
    pytorch深度学习神经网络实现手写字体识别
  • 原文地址:https://www.cnblogs.com/smartyman/p/3798431.html
Copyright © 2011-2022 走看看