search
Homephp教程php手册php 连接 access数据库与修改 删除 增加 数据实例

php 连接 access数据库与修改 删除 增加 数据实例

Jun 13, 2016 am 10:08 AM
accessphpandRevisedeleteIncreaseExampleTutorialdatadatabaseconnect

php教程 连接 access数据库教程与修改 删除 增加 数据实例
本文章提供一款php 连接 access数据库与修改删除增加数据实例哦,首页我们来告诉你利用php 连接 access数据库然后再增加,修改,编辑,显示删除以及数据的分页效果源码。
*/

$conn = new com("adodb.connection");
$conn->open("driver={microsoft access driver (*.mdb)}; dbq=".db_path.";uid=;pwd=;");

$rs=new com("adodb.recordset");
$rs->open("select * from [article] order by [articleid]",$conn,1,3);
$rs->pagesize=5;
$page=trim($_get['page']);
if($page=="" || is_numeric(intval($page))$rs->pagecount){$page=$rs->pagecount;}
$page=intval($page);
if(!$rs->eof||$rs->bof){
 $rs->absolutepage=$page; $mypagesize=$rs->pagesize; $i=$rs->recordcount()-($page-1)*$rs->pagesize; 
 while(!$rs->eof && $mypagesize>0 && $i>=$rs->recordcount()-1-$rs->pagesize*$page){
  $articleid = $rs->fields(0)->value;
  $articletitle = $rs->fields(1)->value; ?>
  

  • echo $articletitle; ?> echo $articlei; ?>

  •    $rs->movenext; $mypagesize--; $i--;  } } ?>
        
       
      
      

       头页 上页 下页 尾页  共 echo $rs->recordcount(); ?>篇文章,分 echo $rs->pagecount;?>页显示,现在是第 echo $page;?>页
      

     
    Statement
    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

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    Video Face Swap

    Video Face Swap

    Swap faces in any video effortlessly with our completely free AI face swap tool!

    Hot Article

    Hot Tools

    MantisBT

    MantisBT

    Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

    SublimeText3 English version

    SublimeText3 English version

    Recommended: Win version, supports code prompts!

    MinGW - Minimalist GNU for Windows

    MinGW - Minimalist GNU for Windows

    This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

    DVWA

    DVWA

    Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

    EditPlus Chinese cracked version

    EditPlus Chinese cracked version

    Small size, syntax highlighting, does not support code prompt function