php - SQL Fatal Error with non-objects -
i have been stuck on problem few days , can't seems work out! trying delete blog entry title posted form through sql , have tried 2 ways, both fail , give following outputs/errors:
test inputstring(10) "test input" fatal error: call member function bind_param() on non-object in 'filepath' on line 163
this code including other way have tried:
$delentry = $_post['postentry']; echo $delentry; //$query2 = "delete blog title =\"" . $delentry . "\""; //echo $query2; //$result2 = mysqli_query($mysqli, $query2); //if (!$result2) { //die('invalid query: ' . mysql_error()); //} $stmt2 = $mysqli->prepare("delete blog title = ?"); var_dump($delentry); $stmt2->bind_param('s', $delentry); $stmt2->execute(); $stmt2->close(); //header("location: listall.php"); exit;
line 163 is:
$stmt2->bind_param('s', $delentry);
any appreciated, thanks!
thanks link @qirel none of solutions have worked, have closed previous forms of $mysqli, attempted enable pdoexceptions telling me cannot done on non-objects , have checked "delete blog title = "test input"" work database. stuck, more appreciated
Comments
Post a Comment