PHPackages                             rhlegacy/mysql-connector - 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. rhlegacy/mysql-connector

ActiveLibrary[Database &amp; ORM](/categories/database)

rhlegacy/mysql-connector
========================

This library assists with easily communicating with a mysql database.

015PHP

Since Jan 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Rhman101/rhlegacy-mysql-connector)[ Packagist](https://packagist.org/packages/rhlegacy/mysql-connector)[ RSS](/packages/rhlegacy-mysql-connector/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

DEPRECATED - Kept here for critical legacy function in some applications
========================================================================

[](#deprecated---kept-here-for-critical-legacy-function-in-some-applications)

php-mysql-connector
===================

[](#php-mysql-connector)

A simple to use mysql connector for quickly connecting your php project with a mysql database

Installation
============

[](#installation)

You can install this library using composer by adding it to your composer.json file

```
"require": {
    "mincdev/mysql-connector": "^1.*"
}

```

or running the following command:

```
composer require mincdev/mysql-connector

```

Usage
=====

[](#usage)

To use the connector, you need to include it in your file and intialise it with your database details.

```
use MySql\Connector;

$conn = new Connector([
    "host"      => "127.0.0.1",
    "user"      => "root",
    "passwd"    => "secret",
    "schema"    => "my_db",
]);

```

Once initialised you can use the connector in the following manner:

### Insert a record

[](#insert-a-record)

```
$conn->prepare("INSERT INTO table_name (column_1, column_2) VALUES (:column_1, :column_2)", [
    ":column_1" => "Hello World!",
    ":column_2" => 1234
])->modify();

```

### Row Count

[](#row-count)

```
$conn->prepare("SELECT * FROM table_name", null)->rowCount();

```

### Fetch Single Column Value

[](#fetch-single-column-value)

```
$conn->prepare("SELECT column_name FROM table_name", null)->query();

```

### Get last insert id

[](#get-last-insert-id)

```
$conn->lastInsertId();

```

### Select row(s)

[](#select-rows)

Returns a single row or multiple rows

```
$conn->prepare("SELECT * FROM table_name", null)->select()

```

### Quickly delete a record

[](#quickly-delete-a-record)

Requires the primary key id to be passed and the table name

```
$conn->delete("table_name", 6);

```

### Quick Insert

[](#quick-insert)

Inserts a record to the specified table using an array as the table structure.

```
$conn->quick_insert("table_name", ["column_1" => "Hello World!", "column_2" => 123]);

```

### Quick Update

[](#quick-update)

Updates a record in the specified table using an array as the table structure.

```
$conn->quick_update("table_name", 9, ["column_1" => "Hello World!", "column_2" => 123]);

```

### Bulk Insert

[](#bulk-insert)

Inserts multiple records to a specified table using an array as the table structure.

```
$conn->bulk_insert("table_name", [
    ["column_1" => "Hello World!", "column_2" => 1],
    ["column_1" => "Hello Galaxy!", "column_2" => 2]
]);

```

### Multi Modify (Multiple Statements)

[](#multi-modify-multiple-statements)

Runs multiple statements on the database one after the other. Each statement is separated by a semi-colon ";"

```
$conn->prepare("DELETE FROM table_name;INSERT INTO table_name (column_1, column_2) VALUES (:column_1, :column_2)", [
    null, // No key value pairs for the delete statement
    [":column_1" => "Hello World!", ":column_2" => 123] // Key value pairs for the second statement (insert)
])->m_modify();

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d3ea70f060eb602e9102f57423f63972391b0959b686200f944feb4706de5d56?d=identicon)[Rhman101](/maintainers/Rhman101)

---

Top Contributors

[![Rhman101](https://avatars.githubusercontent.com/u/29141219?v=4)](https://github.com/Rhman101 "Rhman101 (2 commits)")

### Embed Badge

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

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/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)
