I’m trying to write a simple Sqlite application using PDO library and am having trouble with my insert. I have
$query = $db->prepare("INSERT INTO users (firstname, lastname, phone) VALUES (:firstname, :lastname, :phone)");
$query->execute(array(':firstname'=>$firstname, ':lastname'=>$lastname, ':phone'=>$phone));
but when I execute the code I get
Fatal error: Call to a member function execute() on a non-object
Can anyone enlighten me where I’m going wrong please…