TheInsider
Programmer
Hi,
I'm getting the following error "Fatal error: Call to a member function bind_param() on a non-object" when I call $statement->bind_param('i', $featuredSpecialID); in the following code:
It seems to be unable to prepare the statement. The funny thing is, $featuredSpecialID = 5 and when I run "DELETE FROM featured_special WHERE featured_special_id = 5" in phpMyAdmin, the statement deletes the corresponding row without any problem.
I'm running XAMPP 1.7.2 (PHP v5.3.0) on Windows 7 Home Premium.
I've already confirmed that the user name, host name, database variables are all correct. Any help is appreciated!
TIA
I'm getting the following error "Fatal error: Call to a member function bind_param() on a non-object" when I call $statement->bind_param('i', $featuredSpecialID); in the following code:
Code:
function removeSpecial() {
global $HOST_NAME, $USER_NAME, $PASSWORD, $DATABASE;
$featuredSpecialID = $_POST['featuredSpecialID'];
$mysqli = new mysqli($HOST_NAME, $USER_NAME, $PASSWORD, $DATABASE);
$sql = 'DELETE FROM featured_special WHERE featured_special_id = ?';
$statement = $mysqli->prepare($sql); '*** error seems to be here
$statement->bind_param('i', $featuredSpecialID); '*** crashes here
$statement->execute();
$mysqli->close();
}
I'm running XAMPP 1.7.2 (PHP v5.3.0) on Windows 7 Home Premium.
I've already confirmed that the user name, host name, database variables are all correct. Any help is appreciated!
TIA