setPattern() or returns the response. * * Yooia by Jason Corradino is licensed under a Creative Commons Attribution 3.0 License. * License: http://creativecommons.org/licenses/by/3.0/us/ * * Based on a work at ImYourDeveloper.com. * */ require('database.php'); class query { var $query; var $access; var $db; var $template; var $response; function query($query, $access = 'read') { $this->query = $query; $this->access = $access; $this->databaseSend(); } function setPattern ($template) { $this->template = $template; } function databaseSend () { $db = new Database($this->access); $this->response = $db->query($this->query); } function returnData() { if ($this->template != null && $this->template != "") { while ($row = mysql_fetch_assoc($this->response)) { $split = split ('::', $this->template); foreach ($split as $key => $value) { if ($row[$value] != "") { $split[$key] = $row[$value]; } echo $split[$key]; } } } else { return $this->response; } } } ?>