This is one of many extensions that PHP has to communicate with databases. It is more than clear that this extension is for communicating with MySQL-type DBMS, and the ‘i’ in its name stands for ‘improved,’ meaning enhanced. Introduction In this post, we will see what the extension consists of, so we won’t see much […]
read morePHP mysqli_sql_exception is the class that manages exceptions within the mysqli extension. final class mysqli_sql_exception extends RuntimeException { /* Properties */ protected string $sqlstate = “00000”; /* Inherited properties */ protected string $message = “”; private string $string = “”; protected int $code; protected string $file = “”; protected int $line; private array $trace = […]
read moreThe class mysqli_warning represents a MYSQL warning. class mysqli_warning { /* Propiedades */ public $message; public $sqlstate; public $errno; /* Métodos */ public next(): void } Properties $message – message that gives the warning sqlstate – SQL state (SQLSTATE is a code which identifies SQL error conditions) errno – error number Methods __construct The constructor is private and therefore will not allow direct instantiation of a class. private mysqli_warning::__construct() next Fetches the next warning. public mysqli_warning::next(): […]
read moreThis class will represent the connection driver to our DBMS (MYSQL). The class mysqli_driver is an instance of the monostate pattern (monostate design pattern), meaning there is a single driver that can be accessed by an arbitrary number of mysqli_driver instances. class mysqli_driver { /* Propiedades */ public readonly string $client_info; public readonly string $client_version; […]
read moreThe PHP mysqli_result class represents the result set obtained after running a query. Sinopsis class mysqli_result implements IteratorAggregate { /* Properties */ public readonly int $current_field; public readonly int $field_count; public readonly ?array $lengths; public readonly int|string $num_rows; public int $type; /* Methods */ public __construct(mysqli $mysql, int $result_mode = MYSQLI_STORE_RESULT) public data_seek(int $offset): bool […]
read moreThe PHP class mysqli_stmt represents a prepared statement in MySQL. Sinopsis class mysqli_stmt { /* Properties */ public readonly int|string $affected_rows; public readonly int|string $insert_id; public readonly int|string $num_rows; public readonly int $param_count; public readonly int $field_count; public readonly int $errno; public readonly string $error; public readonly array $error_list; public readonly string $sqlstate; public int […]
read moreThe PHP mysqli class is the main class of the MySQLi extension of PHP. This class represents a connection to the database created with a MySQL DBMS. The following synopsis is the same as that given on PHP.net Sinopsis class mysqli { /* Propiedades */ int $affected_rows; int $connect_errno; string $connect_error; int $errno; array $error_list; […]
read moreComposer Autoload simplifies dependency management in PHP projects by automating the inclusion of classes and libraries, eliminating the need for manual file inclusion. It improves development efficiency, reduces errors, and enhances code organization using namespaces. Additionally, it promotes compatibility with other PHP components, increasing flexibility and scalability in projects. Understanding PSR standards The PSR (PHP […]
read moreIn PHP, there is a group of methods called magic methods that can assist when an event occurs on the object. These methods are invoked without needing to be explicitly called by you, which is why they are referred to as magic methods. Most likely, you are familiar with two of these if you have […]
read moreIn this article, we will see what abstract classes are in PHP and then learn how to use them. ¿What is an abstract class? The following is a small excerpt from the book FUNDAMENTOS DE PROGRAMACIÓN by Luis Joyanes Aguilar. I believe he describes it much better in his book than I could with my […]
read more