Download the PHP package zhangzhaowy/php-mysql without Composer

On this page you can find all versions of the php package zhangzhaowy/php-mysql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-mysql

MySQLi 封装类


声明

此软件是为了满足个人使用习惯而在ThingEngineer/PHP-MySQLi-Database-Class的基础上开发的. 如果你想学习或研究MYSQL,可以去ThingEngineer/PHP-MySQLi-Database-Class.

环境要求

PHP 5.4+ and PDO extension installed

安装

使用之前需要先下载或安装到自己的项目

composer 安装

加载

引入类文件

或者 命名空间引入类文件

初始化

默认 字符集utf8,端口3306:

还可以用数组来初始化:

表前缀、字符集、端口参数都是可选的。

也支持mysqli对象:

如果表有前缀,我们可以定义表前缀:

如果MySQL链接断开,会自动重连一次。 禁用方法:

如果想使用已经创建过的数据库链接:

基本操作

增加

在Insert中使用on duplicate key update

替换

replace() 同 insert() 方法一样;

更新

可以使用where()、limit()等联合查询,详解见查询

删除

查询

获取数据

getAll() 获取多条记录
getOne() 获取一条记录
getColumn() 获取某列数据

From

定义操作表

Select

定义获取列字段

给列定义别名

Join

在join的条件中将表名用``括起来,会自动追加表前缀。

Where

Group By

Having

Having 用法同 Where 用法一样

Order By

Limit

map

将某列的值作为返回结果集的索引

定义结果集类型

Total Count

分页

paginate() 分页
第一个参数是页数
第二个参数是每页记录数量(默认20)。

子查询

需要先定义子查询对象

再通过子查询对象拼装子查询语句

最后子查询作为SQL的查询条件

Query

直接通过Query获取结果

事务

Trace

跟踪SQL、执行时间、文件位置

SQL 关键词

支持的关键词包括:
LOW_PRIORITY | DELAYED | HIGH_PRIORITY | IGNORE ALL | DISTINCT | DISTINCTROW | STRAIGHT_JOIN | SQL_SMALL_RESULT | SQL_BIG_RESULT | SQL_BUFFER_RESULT | SQL_CACHE | SQL_NO_CACHE | SQL_CALC_FOUND_ROWS | QUICK | MYSQLI_NESTJOIN FOR UPDATE | LOCK IN SHARE MODE

多个关键词一起用

错误

SQL执行完成之后,需要执行下面的方法判断是否成功。

帮助方法

关闭数据库连接

数据库连接断开时重新连接

获取最后一次执行的SQL
注:函数返回SQL查询仅用于调试目的,因为它的执行很可能会由于字符变量周围缺少引号而失败。

转义字符串方法


All versions of php-mysql with dependencies

PHP Build Version
Package Version
Requires ext-pdo Version *
php Version ^5.4|^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zhangzhaowy/php-mysql contains the following files

Loading the files please wait ....