定制 ajbassett539/simple-database 二次开发

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

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

ajbassett539/simple-database

Composer 安装命令:

composer require ajbassett539/simple-database

包简介

Simple mysqli database wrapper to retrieve stdClass objects.

README 文档

README

Simple mysqli Database Wrapper to Retrieve stdClass Objects.

Installation

composer require ajbassett539/simple-database

Instantiation

include 'vendor/autoload.php';

$db = new \Database\DB();

Credentials

## .htaccess
SetEnv DATABASE_HOST localhost
SetEnv DATABASE_USER usernaem
SetEnv DATABASE_PASS passwerd
SetEnv DATABASE_NAME fancy_db
SetEnv LOG_SQL_QUERIES 1

Methods

query

public function query($sql = "", $multirow = false, $raw = false)

Takes an SQL string and attempts to execute. You are responsible for sanitization and syntax.

If you anticipate multiple rows, $multirow = true.

If you'd rather have the mysqli result object, $raw = true.

Returns stdClass PHP object(s) for the result or false.

execute

public static function execute($sql = "", $multirow = false, $raw = false)

Does the same exact thing, just called statically.

Creates a new connection for each call, so it's not advisable to use this in a loop.

escape

public function escape($string)

Returns the escaped string.

real_escape

public static function real_escape($string)

Does the same thing, just called statically.

getLastError

public function getLastError()

Returns the last error as string.

affected_rows

public function affected_rows()

Returns the affected rows of the last query.

insert_id

public function insert_id()

Return the insert id of the last query.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-01-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固