Sql_Controller
in package
SQL.
Tags
Table of Contents
Properties
- $instance : mixed
- The singleton instances.
- $_config : array<string|int, mixed>|null
- $_Core_DataBase : Core_DataBase|null
Methods
- __construct() : mixed
- execute() : mixed
- Выполнение SQL-запроса
- executeByFile() : mixed
- Выполнение SQL-запроса из файла
- executeByString() : mixed
- Выполнение SQL-запроса из строки
- instance() : object
- Register an existing instance as a singleton.
- sanitizeIdentifiers() : string
- Sanitize MySQL Identifiers
- _executeQuery() : bool
- Выполнение SQL-запроса из строки с подменой ENGINE и CHARSET
Properties
$instance
The singleton instances.
public
static mixed
$instance
= \NULL
$_config
protected
array<string|int, mixed>|null
$_config
= \NULL
$_Core_DataBase
protected
Core_DataBase|null
$_Core_DataBase
= \NULL
Methods
__construct()
public
__construct() : mixed
execute()
Выполнение SQL-запроса
public
execute(string $sql) : mixed
Parameters
- $sql : string
-
SQL-запрос
Tags
Return values
mixed —количество выполненных запросов или NULL
executeByFile()
Выполнение SQL-запроса из файла
public
executeByFile(string $filePath) : mixed
Parameters
- $filePath : string
-
путь к файлу
Return values
mixed —количество выполненных запросов или NULL
executeByFile(CMS_FOLDER . 'sql/myfile.sql');
?>
executeByString()
Выполнение SQL-запроса из строки
public
executeByString(string $sql) : mixed
Parameters
- $sql : string
-
SQL-запрос
Return values
mixed —количество выполненных запросов
Sql_Controller::instance()->executeByString($sql);
?>
instance()
Register an existing instance as a singleton.
public
static instance() : object
Return values
objectsanitizeIdentifiers()
Sanitize MySQL Identifiers
public
static sanitizeIdentifiers(mixed $str) : string
Parameters
- $str : mixed
Return values
string_executeQuery()
Выполнение SQL-запроса из строки с подменой ENGINE и CHARSET
protected
_executeQuery(string $sql) : bool
Parameters
- $sql : string
-
SQL-запрос