All pastes #934235 Raw Edit

Miscellany

public php v1 · immutable
·published 2008-03-08 18:33 UTC
rendered paste body
<?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';        }        }}?>