I do not understand why I am getting an error.. I have done this hundreds of times. Here's the error that I'm getting: Fatal error: Call to a member function execute() on a non-object in xxx/core.php on line 11 Code (markup): Here's the code: $sendMessage = $db->prepare("INSERT INTO shouts SET message = ?"); $message = 'wtf'; $sendMessage = $sendMessage->bind_param('s', $message); $sendMessage->execute(); PHP:
Issue sorted - I'm an idiot. $sendMessage = $sendMessage->bind_param('s', $message); Code (markup): Should just be: $sendMessage->bind_param('s', $message); Code (markup):