Jump to content


New Members
  • Posts

  • Joined

  • Last visited


About Ovenmit

  • Birthday 12/26/1982

Profile Information

  • Gender
  • Location
    CT, South AFrica

Ovenmit's Achievements


Newbie (1/5)



  1. Sorry, had to step out and see a client. Running it as a straight query works. Thanks a bunch, that was the problem lol, 'ssss' instead of 'i,s,s,s'. Stupid mistake on my part and thanks for the date tip. - SOLVED -
  2. Not sure how to answer... because I wanted to use a prepared statement? Are you saying I should just go with a straight query? ie: $query = "INSERT INTO articles (pubdate, title, summary, content) VALUES('$date', '$header', '$summary', '$content')";
  3. 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!
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.