jasny/db-mysql 问题修复 & 功能扩展

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

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

jasny/db-mysql

最新稳定版本:v1.1.1

Composer 安装命令:

composer require jasny/db-mysql

包简介

A simple DB layer in PHP for using MySQL

README 文档

README

Build Status

A simple DB layer in PHP for using MySQL, featuring

  • Global connection (singleton)
  • Parameter binding
  • Quoting tables/fields and values
  • Fetch all rows, column, key/value pair and single value
  • Simple saving by passing associated arrays
  • Query exceptions (instead of returning false)

Installation

Jasny DB-MySQL is registred at packagist as jasny/db-mysql and can be easily installed using composer. Alternatively you can simply download the .zip and copy the file from the 'src' folder.

Example

<?php
    new DB($host, $user, $pwd, $dbname);
    $result = DB::conn()->query("SELECT * FROM foo");
    $result = DB::conn()->query("SELECT * FROM foo WHERE type = ?", $type);
    $result = DB::conn()->query("SELECT * FROM foo WHERE type = ? AND cat IN ?", $type, array(1, 7));

    $items = DB::conn()->fetchAll("SELECT id, name, description FROM foo WHERE type = ?", MYSQLI_ASSOC, $type);
    $item  = DB::conn()->fetchOne("SELECT * FROM foo WHERE id = ?", MYSQLI_ASSOC, $id);
    $names = DB::conn()->fetchColumn("SELECT name FROM foo WHERE type = ?", $type);
    $list  = DB::conn()->fetchPairs("SELECT id, name FROM foo WHERE type = ?", $type);
    $name  = DB::conn()->fetchValue("SELECT name FROM foo WHERE id = ?", $id);

    DB::conn()->save('foo', $values);
    DB::conn()->save('foo', array($values1, $values2, $values3));

API documentation (generated)

http://jasny.github.com/DB-MySQL/docs

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-11-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固