Skip to content

Database - class for easy work with MySql database using the extension PHP mysqli. This class uses placeholders technology - to generate the correct SQL-queries, the query string instead of the values written special typed markers - placeholders and the data are transferred "after", as a follow-argument main method of executing SQL-query. Databa…

Notifications You must be signed in to change notification settings

clientlab-dev/Database

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 

Repository files navigation

Rus

Класс для простой работы с СУБД MySql с использованием расширения PHP mysqli.

Данный класс использует технологию placeholders - для формирования корректных SQL-запросов, в строке запроса вместо значений пишутся специальные типизированные маркеры - заполнители, а сами данные передаются "позже", в качестве последующих аргументов основного метода, выполняющего SQL-запрос:

$db->query('SELECT * FROM `t` WHERE `name` = "?s" AND `age` = ?i', $_POST['name'], $_POST['age']);

Данные, прошедшие через систему placeholders, экранируются специальными функциями экранирования, в зависимости от типа заполнителей. Т.е. вам нет необходимости заключать переменные в функции экранирования типа mysqli_real_escape_string($value) или приводить их к числовому типу через (int)$value.

Подробное описание см. в файле /Mysql.php или на сайте database.phpinfo.su

Eng

Database - class for develop with database mysql, use adapter PHP mysqli and use placeholder, when each literal (argument) in string SQL query escaping without specific PHP functions like a mysqli_real_escape_string().

$db->query('SELECT * FROM `t` WHERE `name` = "?s" AND `age` = ?i', $_POST['name'], $_POST['age']);

The data passed through the placeholders, screened by special screening function, depending on the type of filler. Ie you do not need to enter variables in the screening function type mysqli_real_escape_string($value) or bring them to a numeric type (int)$value.

Details, see the file /Mysql.php or website database.phpinfo.su.

About

Database - class for easy work with MySql database using the extension PHP mysqli. This class uses placeholders technology - to generate the correct SQL-queries, the query string instead of the values written special typed markers - placeholders and the data are transferred "after", as a follow-argument main method of executing SQL-query. Databa…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%