Structured Query Language (SQL)¶
Structured Query Language, SQL, is a database query language, used to access and update data in a relational database management system.
PHP supports several RDBMS natively, such as: Mysql, Oracle, IBM db2, DBA, ODBC. PHP also offers a database abstraction layer, called PDO.
<?php
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$mysqli = new mysqli('example.com', 'user', 'password', 'database');
$mysqli->query('DROP TABLE IF EXISTS test');
$mysqli->query('CREATE TABLE test(id INT)');
?>
See also phpMyAdmin, PHP and SQLite and PostgreSQL PHP.
Related : PHP Data Objects (PDO), Relational DataBase Management System (RDBMS), Object Relational Mapping (ORM), Active Record, Prepared Query, Query, SQLite3, SQL Database, Graph Database, N+1 Query Problem, PostgreSQL, Star *, Escape Character, mysqli