On 16/05/07, Lee PHP <leephp@xxxxxxxxx> wrote:
/** Insert record. */ public function insert() { $sql = "INSERT INTO table (" . "field_1, " . "field_2, " . "field_3) " . "?, " . "?, " . "?)"; echo "Server version: " . self::$conn->server_info; $stmt = self::$conn->prepare($sql); $stmt->bind_param('sssssssssssss', $this->getField1(), $this->getField2(), $this->getField3());
Server version: 5.0.21-Debian_3ubuntu1-log Fatal error: Call to a member function bind_param() on a non-object in C:\blah\blah\blah
You've missing an open bracket in your INSERT statement. This is causing your prepare() to fail, returning FALSE rather than a statement object. You then call bind_param() on that and because it's not an object you get the fatal error. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php