WEB DEVELOPMENT
[edit]

[MySQLi] Procedural Syntax

Connect


$conn = mysqli_connect("host", "username","password","database");
mysqli_set_charset($conn, "utf8mb4");
      
if ($conn->connect_error) {
    die "Not connected, error: " . $conn->connect_error;
} else {
    echo "Connected.";
}


   
mysqli_close($conn);

https://www.php.net/manual/en/

Query


mysqli_query($conn, $query);



mysqli_execute_query() - Prepares, binds parameters, and executes SQL statement
mysqli_real_query() - Execute an SQL query
mysqli_multi_query() - Performs one or more queries on the database
mysqli_prepare() - Prepares an SQL statement for execution
mysqli_free_result() - Frees the memory associated with a result

https://www.php.net/manual/en/mysqli.query.php