Skip to content

dhruv1110/MySQLi-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

MySQLi-PHP

Library for MySQLi intigration in PHP ##How to use Change the MySQLi credentials in database.php file.

private $db_host = DB_HOST;
private $db_user = DB_USER;
private $db_pass = DB_PASSWORD;
private $db_name = DB_NAME;

Create Databse object

$db = new Database();

Call this method first to establish MySQLi connection to server

$db->connect();

###Executing SQL query

$q = $db->sql(YOUR_SQL_STATEMENT);

###Executing SQL SELECT query

$q = $db->sql(TABLE_NAME, [$rows="*", JOIN_STATEMENT = null, WHERE_STATEMENT = null, ORDER = "ASC", LIMIT]);

Here's only first argument is mandatory, others is optional

$rows : default argument is set to "*", means select all rows, otherwise you have to pass array of collumn names $join : default argument is set to null $where : default argument is set to null, Where clouse of your SQL statement $order : default argument is set to "asc", options : "asc" or "desc" $limit : any integer, number of rows retrieved

---

About

Library for MySQLi intigration in PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages