Chapter 2 PAWEB (1)
Chapter 2 PAWEB (1)
<?php
session_start();
6
Difference between session_destroy() and session_unset(): session_destroy() removes
all session data, while session_unset() only clears the session data for that user.
// get the ID
$last_id = mysqli_insert_id($conn);
echo "New record created successfully. Last inserted ID is: " . $last_id;
7
Delete: Removing Data from the Database
<?php
$sql = "DELETE FROM users WHERE id=2";
$result = mysqli_query($conn, $sql);