定制 jkanetwork/dbwrapper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jkanetwork/dbwrapper

Composer 安装命令:

composer require jkanetwork/dbwrapper

包简介

MySQL, PgSQL and SQLite wrapper

README 文档

README

This script is a simple wrapper for SQLite3, MySQL and PgSQL, for make possible to use different BD systems without changing the functions.

Installation

In composer:

composer require jkanetwork/dbwrapper "~2.0.1"

By hand: Download the php file inside src folder

Avalible functions:

  • To connect

      //$server is location in SQLite3
      resource dbw_connect (string $tdb,string $server[,string $database, string $user,string $password]);
    
  • To close

       //Closes connection
      bool dbw_close (resource $conn);
    
  • Queries

      //Does a query (array, or false if error)
      resource dbw_query (resource $conn, string $query);
      //This does a (non interactive) multiquery. Its used for load from a file/script for example.
      bool dbw_multi_query(resource $conn, string $multiquery);
      //This do a query and fetch array (One restult), all in one function($typearray optional, see below)
      resource dbw_query_fetch_array (resource $conn,string $query[, string $typearray]);
      //Return query as array (All results), all in one function($typearray optional, see below)
      resource dbw_query_fetch_all (resource $conn,string $query[, string $typearray]);
      //dbw_fetch_all is too for queries)
    
  • Using result of a query

    //Fetch a row. ($typearray optional, see below)
      array dbw_fetch_array (resource $conn,resource $result[, string $typearray]);
      //Wrappers of dbw_fetch_array with row or assoc arguments
      array dbw_fetch_row(resource $conn,resource $result);
      array dbw_fetch_assoc(resource $conn,resource $result);
      //Goto X result of a query (Not retrieve it). If row is not specified, will be first row, 0
      bool dbw_query_goto(resource $conn,resource $result[,int $row]);
    // Wrappers to dbw_query_goto are dbw_data_seek and dbw_result_seek for compatibility
    	
      //Return number of results of a query
      int dbw_num_rows(resource $conn, resource $result);
    
  • Without a query

      // Escapes conflictive chars for inserting into database
      string dbw_escape_string(resource $conn,string $string);
      //Returns last insert ID
      int dbw_last_id(resource $conn);
      //Alias of dbw_last_id
      int dbw_insert_id(resource $conn);
    
  • Important details

      $tdb (Type of database) can be:
          -mysql/mysqli -> MySQL or MariaDB
          -sqlite/sqlite3 -> Sqlite3
          -PostgreSQL/PgSQL/pg -> PostgreSQL
          -mssql/sqlsrv -> Microsoft SQL Server (Needs sqlsrv lib installed)
            
      $conn is the connection stablished in dbw_connect (ie. $conn = dbw_connect('sqlite','file.sqlite'))
        
      $typearray is the form of array is returned, and not writed is default:
          -ASSOC -> Associative indexes
          -NUM -> Numeric indexes
          -BOTH -> (Default) Both types of indexes 
    

统计信息

  • 总下载量: 65
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-09-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固