mrpck/mysqldb

The MySqlDB Class Library is a high level wrapper around the MySql.

1.0.3 2021-02-07 01:26 UTC

This package is auto-updated.

Last update: 2024-10-22 02:14:26 UTC


README

The MySqlDB Class Library is a high level wrapper around the MySql.

Install

Copy the files under src/ to your program

OR

composer require mrpck/mysqldb 1.0.2

Usage

use Mrpck\Mysqldb\MySqlDB;

// connecting to db
$db = new MySqlDB("localhost", "mydb");
if (!$db->db_connect_id) exit;

$sql = "SELECT id, name, surname, phone, email FROM `users` ";
$result = $db->sql_query($sql);		
$num_records = $result ? $db->get_num_rows($result) : 0;

// check if row inserted or not
if ($num_records > 0) 
{
	while ($row = $db->sql_fetchrow( $result )) 
	{
		echo "<br/>";
		print_r($row);
	}
	$db->sql_freeresult($result);
}