public function testAllTypesSelects() { // SQL query $sql = 'SELECT * FROM users'; // Executes the SQL and stores the result $result = test::select($sql); $this->assertEquals(1, self::getNumRows($result)); // Executes the SQL and stores the result $result_num = test::selectNum($sql); $this->assertEquals(1, self::getNumRows($result_num)); // Executes the SQL and stores the result $result_obj = test::selectObj($sql); $this->assertEquals(1, self::getNumRows($result_obj)); // Executes the SQL and stores the result $result_all = test::selectAll($sql); $this->assertEquals(1, self::getNumRows($result_all)); }
/** * All Selects * * */ public function allSelects() { // SQL query $sql = self::sql(); // Executes the SQL and stores the result $result = PDO4You::select($sql); $result_num = PDO4You::selectNum($sql); $result_obj = PDO4You::selectObj($sql); $result_all = PDO4You::selectAll($sql); echo '<div class="code title">Demo with the method PDO4You::select()</div>'; echo '<div class="code debug">PDO4You::select(' . $this->getQuery($sql) . '); ' . $this->getResult($result) . '</div>'; echo '<div class="code title">Demo with the method PDO4You::selectNum()</div>'; echo '<div class="code debug">PDO4You::selectNum(' . $this->getQuery($sql) . '); ' . $this->getResult($result_num) . '</div>'; echo '<div class="code title">Demo with the method PDO4You::selectObj()</div>'; echo '<div class="code debug">PDO4You::selectObj(' . $this->getQuery($sql) . '); ' . $this->getResult($result_obj) . '</div>'; echo '<div class="code title">Demo with the method PDO4You::selectAll()</div>'; echo '<div class="code debug">PDO4You::selectAll(' . $this->getQuery($sql) . '); ' . $this->getResult($result_all) . '</div>'; }