Skip to content

ImSkully/php-mysqli-simplified

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP MySQLi Simplified

Latest Stable Version License composer.lock

A further improved and simplified usage of the MySQLi driver achieved by using overload functions that provide simplistic usage and a shorter syntax.


API Functions

fetch($db, $query)

Executes the specified query and returns the first result.

@param   $db     String  The database name to use for this query.
@param   $query  String  The SQL query.
@return  bool|string[]   The mysqli response if fetch was successful, false otherwise.

fetchAll($db, $query)

Executes the provided query and returns an array of all results.

@param   $db     String  The database name.
@param   $query  String  The SQL query.
@return  array|bool      An array containing the mysqli response if fetch was successful, false otherwise.

execute($db, $query)

Executes the provided query.

@param   $db     String  The database name.
@param   $query  String  The SQL query.
@return  bool            Returns true if the query executed, false otherwise.

escape($data, $db)

Runs the mysqli_escape_string() to escape special characters from the string.

@param   $data   String  The variable or data to escape.
@param   string  $db     The database of which charset to use, if none provided then the default server is used.
@return  String          Returns the data escaped.