mrpck / mysqldb
The MySqlDB Class Library is a high level wrapper around the MySql.
1.0.3
2021-02-07 01:26 UTC
Requires
- php: >=5.4.0
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); }