The code in question is like this:
if (isset($_SESSION['logged_in'])) {
if (isset($_POST['title'], $_POST['content'], $_POST['id'])) {
$title = $_POST['title'];
$content = $_POST['content'];
$id = $_POST['id'];
}
if (empty($title) or empty($content) or empty($id)) {
$error = 'All fields are required!';
} else {
try {
$query = $pdo->prepare("UPDATE articles SET article_title = ?, article_content = ? WHERE article_id = ? ");
$query->bindValue(1, 'title');
$query->bindValue(2, 'content');
$query->bindValue(3, 'id');
$query->execute();
header('Location: index.php');
} catch (PDOException $e) {
print_r($e->errorInfo);
die();
}
}
}
It gives me no error whatsoever and the table does not update.
P.S. I am quite new to PHP in general so please bear with me if my errors are somewhat trivial, I just don't have anyone else to ask.