replaced $db->query() with $db->execute()