Miscellany
public php v1 · immutable<?php$db = new mysqli('localhost','user','pass');$crawl = new crawl($db);$crawl->check_db();class crawl { private $db; function __construct(&$db) { $this->db =& $db; } // An example of trying to integrate my database opject function check_db(){ $query = "SELECT NOW() AS now"; if($stmt=$this->db->query()){ $stmt->execute(); $stmt->bind_result($now); $stmt->fetch(); $stmt->close(); echo $now; } else { echo 'Unable to prepare statement'; } }}?>