Hi, Im just having some trouble with this...maybe a fresh pair of eyes can help?
Im getting a "Warning: mysqli_stmt::bind_param() [mysqli-stmt.bind-param]: Number of elements in type definition string doesn't match number of bind variables" error when I try run this:
$date = date("Y-m-d");
$header = $_POST['header'];
$summary = $_POST['summary'];
$content = $_POST['content'];
$query = "INSERT INTO articles (pubdate, title, summary, content) VALUES(?, ?, ?, ?)";
$stmt = $mysqli->stmt_init();
if ($stmt->prepare($query)){
$stmt->bind_param('i,s,s,s', $date, $header, $summary, $content);
$stmt->execute();
$stmt->close();
}
else {
echo "ERROR: SQL statement failure!";
echo "<a href='addnews.php'> -> OK</a>";
}
$mysqli->close();
It looks fine to me, just can't see whats wrong lol!