Possible Duplicate:
Call to a member function bind_param() on a non-object
I'm getting the following error:
Call to a member function bind_param() on a non-object Here's the prepared statement:
include('/path/to/connection/variable.php'); This file is verified to be working it's just creates an instance of the mysqli class, example:
$mysqli = new mysqli("localhost", "user", "password", "db"); So I know that's not the issue...
$stmt = $mysqli->prepare("INSERT INTO `users` VALUES (?,?,?,?,?,?,?)"); $stmt->bind_param("sssssss", $firstname, $lastname, $email, $subscribed, $signup_date, $unsubscribe_date, $signup_source); $stmt->execute(); $stmt->close(); $mysqli->close(); Variable types are as follows:
$firstname = string $lastname = string $email = string $subscribed = char (Y or N) $signup_date = DATE - date('Y-m-d') $unsubscribe_date = DATE - 0000-00-00 Entered Initially $signup_source = string I've tried to find all the usual suspects, checked the connection, basically I wrote a separate SELECT statement and it works. "USERS" is a valid table. Permissions for the connection are root, so that's not the issue. I've switched the types for dates between "s" and "d", and even tried everything with dummy variables - no difference.
I'm hoping it's something simple - because I've been racking my brain for the past hour now, and I can't see anything wrong with the statement above.
FALSEonvar_dump($stmt), which is what's confusing me, because the statement has the correct syntax, it's a correct table, and the field count is correct, etc.