1$stmt = $mysqli->prepare("DELETE FROM myTable WHERE id = ?");
2$stmt->bind_param("i", $_SESSION['id']);
3$stmt->execute();
4$stmt->close();
5Copy
1$stmt = $mysqli->prepare("INSERT INTO myTable (name, age) VALUES (?, ?)");
2$stmt->bind_param("si", $_POST['name'], $_POST['age']);
3$stmt->execute();
4$stmt->close();
5Copy
1$stmt = $mysqli->prepare("UPDATE myTable SET name = ? WHERE id = ?");
2$stmt->bind_param("si", $_POST['name'], $_SESSION['id']);
3$stmt->execute();
4$stmt->close();
5Copy