承接 aldisaglobal/mysql-db 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

aldisaglobal/mysql-db

Composer 安装命令:

composer require aldisaglobal/mysql-db

包简介

A Simple Iterateable MySQL DB Query Object

README 文档

README

Vendor: aldisaglobal
Package: mysql-db
Author: Abid
Version: 0.2

Connection Parameters

Make available the following Connection parameters:

  • MYSQL_HOST the URI for the MySQL server
  • MYSQL_USER the username
  • MYSQL_PASS the password
  • MYSQL_DB the database

Option 1: As Environment Variables

Place connection params in $_ENV superglobal Optional: You can use the \vlucas\dotenv package with a .env file to populate $_ENV variables

Option 2: As Constants

You can define these constants in a settings file

Option 3: As an Array

You can create and pass a parameters array to the create method $params = array('MYSQL_HOST'=>"hostname", ...)

Instantiate a Database Object

Use the static create method to get the DB object:

use AldisaGlobal\MySQL\DB;

$db = DB:create([$params]);

Execute queries on the Database Object

$db->query("...mysql statement...");

Iterate SELECT Queries

foreach ($db as $row) {
	echo $row->field;
}

The full Object API

\AldisaGlobal\MySQL\DB::create([$params]) - returns object with connection

$db->init() - closes any open result

$db->escape($str) - returns escaped string

$db->getResponse()- returns last server response

$db->getError() - returns error string from last query

$db->getErrno()- returns errno from last query

$db->hasError() - true if last query had an error

$db->query($sql [, $buffered=true])- executes query, pass false as second arg for unbuffered query

$db->hasResult() - whether query returned a result

$db->getInsertID()- returns InsertID of last insert query

$db->getRow()- returns the current row

$db->getNextRow([$mode = "object"])- returns next row of result as object [pass "array" to get back an assoc array]

$db->getFirstRow([$mode = "object"]) - returns first row of result as object

$db->getRowNum($num [, $mode = "object"]) - returns row at $num index

$db->getNumFields()- returns number of columns in result row

$db->getFields() - returns array of column names

$db->getNumRows() - returns total number of rows in result [not accurate for unbuffered queries]

aldisaglobal/mysql-db 适用场景与选型建议

aldisaglobal/mysql-db 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 10 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 aldisaglobal/mysql-db 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 aldisaglobal/mysql-db 我们能提供哪些服务?
定制开发 / 二次开发

基于 aldisaglobal/mysql-db 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-26