sumpygump/qi-db 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sumpygump/qi-db

Composer 安装命令:

composer require sumpygump/qi-db

包简介

Basic database adapter

README 文档

README

Qi Db provides PHP library classes for running SQL on databases.

Installation with Composer

Use composer to include the Qi\Db library in a project.

composer require sumpygump/qi-db

If you don't have composer already installed, this is my recommendation for installing it. See getcomposer.org installation instructions.

Once the files have been composed with the composer install command, you can use any of the Qi\Db classes after composer's autoloader is included.

require 'vendor/autoload.php';

$db = new Qi\Db\PdoMysql();
// ...

Manual Installation

You can also download the files and place them in a library folder. If you do this, be sure to update your autoloader to handle the Qi_Db_* classes or else manually include the files of the classes you'll need.

Basic Usage

This is some example code that illustrates connecting to a Mysql database:

$dbConfig = [
    'host' => 'localhost',
    'db'   => 'databasename',
    'user' => 'username',
    'pass' => 'mypassword',
];
$db = new Qi\Db\PdoMysql($dbConfig);

This is some example code that illustrates using the insert() and fetchRow() methods of the PdoMysql class.

// This will insert a new record into a `users` table
$newRow = [
    'email' => 'test@example.com',
    'first_name' => 'Joe',
    'last_name' => 'Schmoe',
];
$db->insert('users', $newRow);

// This will fetch a user by email address
$user = $db->fetchRow("SELECT * FROM `users` WHERE `email`=?", ['test@example.com']);

Please check the class source code for the full list of other methods that can be used.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-09-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固