What are some basic SQL queries that PHP developers should be familiar with?

One basic SQL query that PHP developers should be familiar with is selecting data from a database table. This query retrieves specific data from a table based on certain conditions. Another important query is inserting data into a database table, which adds new records to the table. PHP developers should also know how to update existing data in a table using the UPDATE query. Lastly, the DELETE query is essential for removing unwanted data from a table. Example PHP code snippet for selecting data from a database table:

<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

$sql = "SELECT id, name, email FROM users WHERE id = 1";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
        echo "ID: " . $row["id"]. " - Name: " . $row["name"]. " - Email: " . $row["email"]. "<br>";
    }
} else {
    echo "0 results";
}

$conn->close();
?>