php - Mysqli Prepare statement not working -
i getting following error when attempting execute prepared statement using mysqli.
any determine doing incorrectly appreciated.
fatal error: call member function prepare() on non-object in etc.
i connecting using statement:
<?php $dbhost = "localhost"; $dbuser = "xxxxxx"; $dbpass = "xxxxxx"; $dbname = "creati38_chicos"; $dbconn = new mysqli($dbhost, $dbuser, $dbpass, $dbname); // check connection if ($dbconn->connect_error) { //echo $dbconn->connect_error; die('sorry, having problems right now. please check later.'); } else{ echo "you have connected successfully"; } ?>
i using statement:
<?php if ((isset($_post["update"])) && ($_post["update"] == "update appliance")) { $stmt = $mysqli->prepare("update appliances set category = ?, make = ?, model = ?, description = ?, price = ? id = ?"); $stmt->bind_param('ssssdi', $_post['category'], $_post['make'], $_post['model'], $_post['description'], $_post['price'], $_post['id']); $stmt->execute(); $stmt->close(); } ?>
it's not $mysqli->prepare(
in case $dbconn->prepare(
Comments
Post a Comment