public static function connect($host, $user, $password, $dbname) { self::$db = new mysqli($host, $user, $password, $dbname); $error = self::$db->connect_error; if ($error) { self::throw_error($error); } }
private function setUpDB() { PancakeTF_MysqliAccess::connect('localhost', 'root', '', 'pancake_tests'); $this->db = new PancakeTF_MysqliAccess(); $sql = file_get_contents(dirname(__FILE__) . '/../db/test_sql.sql'); $sql = explode(';', $sql); foreach ($sql as $stmt) { try { $this->db->update($stmt); } catch (Exception $e) { } } }