Hi guys,
I’ve checked this for hours and can’t see anything wrong, but why I cannot insert data into my database.
$sql = "
INSERT INTO topics(
uid, dates, title, content, tag
)
VALUES(
:id, :date, :title, :content, :tag
)
";
try {
$statement = $conn->prepare($sql);
$statement->execute(array(
":id" => $id,
":date" => $date,
":title" => $title,
":content" => $content,
":tag" => $tag
));
header("location: index.php");
} catch(PDOException $e) {
echo $e->getMessage();
}
All the variables are not null but it goes to the index.php without doing anything.
Thanks