nickyeoman / php-mysql-helper
makes life easier when working with mysql in php8
Installs: 130
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/nickyeoman/php-mysql-helper
README
mysql helper class for php 8
see: https://www.nickyeoman.com/blog/php/php-mysql-insert-from-array/
composer: https://packagist.org/packages/nickyeoman/php-mysql-helper
Usage
Connect
Here is how you connect to a database.
require_once 'vendor/autoload.php'; // Composer USE Nickyeoman\Dbhelper; $db = new Nickyeoman\Dbhelper\Dbhelp('127.0.0.1', 'username', 'thePassword', 'databaseName', '3306'); $db->close();
Update a row
$array = array( 'id' => 'unique_key', 'content' => 'data value' ) $id = 'id'; // The key of the array to use as the lookup $db->update("name_of_db_table, $array, $id);