I am well and truly stumped on this one. Here is a prepare bind command that I am using to activate a users account:
$query = "UPDATE `users` SET `active` = b'1' WHERE `UUID` = ?";
$stmt_update = $mysqli->prepare( $query );
$stmt_update->bind_param( 'i' , $uuid );
$stmt_update->execute();
So active is a bit(1) field in MySQL and UUID is the users Unique ID and when I run it I get the error:
Fatal error: Call to a member function bind_param() on a non-object in /websites/.../activate.php on line 34
I do have another query that runs on the page and I do close it off with $stmt->close;
I tried a var_dump($stmt_update);
which returns bool(false)
The query runs fine in PHPMyAdmin just not getting it's prepare set up =¬(
UPDATE
Switched the field to a boolean and changed my query to this:
$query = "UPDATE `users` SET `active` = 1 WHERE `UUID` = ?";
No avail as it is still not preparing the statement. Any more ideas?
Right turns out I was missing () of my close command form the previous statement. I was using $stmt->close;
not $stmt->close();
It's always the smallest things....
Anyway I changed my field back to a bit and active = b'1'
worked fine HUZZAR