public function getConnection() { if (self::$connection) { $this->setConnection(app::getConnection()); } return self::$connection; }
public function selectAction() { //$hlp = new service_helper_sql(); $sql = urldecode($this->getRequest()->getParam('select', null)); service_helper_sql::assertSqlReadonly($sql); $stmt = app::getConnection()->prepare($sql); $stmt->execute(); $all = $stmt->fetchAll(pdo::FETCH_ASSOC); //echo '<pre>'; //print_r($all); echo service_helper_csv::arraysToCsv($all); }
public function __construct() { $this->setConnection(app::getConnection()); }