PHPackages                             flo5581/mysql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. flo5581/mysql

Abandoned → [flostone/mysql](/?search=flostone%2Fmysql)Library[Database &amp; ORM](/categories/database)

flo5581/mysql
=============

MySQL Library for plain php and other applications

1.3.0(8y ago)0170[1 issues](https://github.com/flo5581/mysql/issues)PHP

Since May 12Pushed 8y ago2 watchersCompare

[ Source](https://github.com/flo5581/mysql)[ Packagist](https://packagist.org/packages/flo5581/mysql)[ RSS](/packages/flo5581-mysql/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)DependenciesVersions (32)Used By (0)

\#MySQL helper for any PHP Project ##Installation `require flostone/mysql-plainphp`
\##Usage Include the class using
`use FloStone\MySQL\MySQL;`
Connect to the database using
`$sql = MySQL::connect(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE);`
Now execute queries with the query function
`$results = $sql->query("SELECT * FROM projects");`
The results will always be returned immediately however you can also get the results using
`$results = $sql->results();`\##Using Statements If you want to make it a little easier you can also use several statements as functions.
E.g. if you wanted to make a where clause you could also write
`$projects = $sql->select('*')->where('id', '=', 1)->get();`
In order to use these statements you first have to specify a table:
`$sql->table('projects');`
The table name will stay the same for every query until you eventually change it.
You can also chain the table with several statements:
`$projects = $sql->table('projects')->select('*')->where('name', 'like', '%Test%')->orWhere('title', '=', 'Testingproject')->get();`
Generally it works as the Laravel Eloquent Builder, which it is based on.
\###Available Statements `public function insert(array $columns, array $values);`
`public function create($table, $closure)`
`public function update($id, array $columns, array $values);`
`public function drop($table);`
`public function table($table);`
`public function select($select = '*');`
`public function where($column, $operator, $value = NULL);`
`public function orWhere($column, $operator, $value = NULL);`
`public function whereIn($column, array $values);`
`public function join($table, $primary, $operator, $other = NULL);`
`public function leftJoin($table, $primary, $operator, $other = NULL);`
`public function rightJoin($table, $primary, $operator, $other = NULL);`
`public function outerJoin($table, $primary, $operator, $other = NULL);`
`public function fullOuterJoin($table, $primary, $operator, $other = NULL);`
`public function orderBy($column, $order = 'desc');`
`public function all()`
`public function raw($sql);`
`public function columnExists($column);`
In some cases the operator may also be the value, in that case the operator will be set to '=' by default.
\###Create function closure When you want to use the "create" function, you need to pass in a closure or anonymous function as second argument.
This function takes one parameter:
`function($table){}`
The table parameter is a "Blueprint" instance, which is used to define certain fields in you table.
A basic example of a create query could look like this:
`$sql->create('projects', function(Blueprint $table){ $table->increments(); $table->string('name'); $table->timestamps(); });`
\####Blueprint functions `public function increments($name = 'id');`
`public function string($name, $null = false, $length = 255);`
`public function integer($name, $null = false, $unsigned = false);`
`public function text($name, $null = false);`
`public function custom($customquery);`
`public function timestamps();`
A custom query must be implemented as one column definition:
`tinyint(1) DEFAULT 0 NOT NULL`

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Recently: every ~72 days

Total

30

Last Release

3169d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/63fd1957ec0fd3b62eb4a10e5799ddaa79fba822aaaf40c39c7d2ce872846c17?d=identicon)[FloStone](/maintainers/FloStone)

---

Top Contributors

[![adiwidjaja](https://avatars.githubusercontent.com/u/280394?v=4)](https://github.com/adiwidjaja "adiwidjaja (12 commits)")

### Embed Badge

![Health badge](/badges/flo5581-mysql/health.svg)

```
[![Health](https://phpackages.com/badges/flo5581-mysql/health.svg)](https://phpackages.com/packages/flo5581-mysql)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M114](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
