|
@@ -151,7 +151,7 @@ discard block |
|
|
block discarded – undo |
151
|
151
|
* @param array $where Should be the field names and values you wish to use as the where query e.g. array('fieldname' => 'value', 'fieldname2' => 'value2', etc).
|
152
|
152
|
* @param string|array $fields This should be the records you wis to select from the table. It should be either set as '*' which is the default or set as an array in the following format array('field', 'field2', 'field3', etc).
|
153
|
153
|
* @param array $order This is the order you wish the results to be ordered in should be formatted as follows array('fieldname' => 'ASC') or array("'fieldname', 'fieldname2'" => 'DESC')
|
154
|
|
- * @param integer|array $limit The number of results you want to return 0 is default and returns all results, else should be formated either as a standard integer or as an array as the start and end values e.g. array(0 => 150)
|
|
154
|
+ * @param integer $limit The number of results you want to return 0 is default and returns all results, else should be formated either as a standard integer or as an array as the start and end values e.g. array(0 => 150)
|
155
|
155
|
* @param boolean $cache If the query should be cached or loaded from cache set to true else set to false
|
156
|
156
|
* @return array Returns a multidimensional array with the chosen fields from the table
|
157
|
157
|
*/
|
|
@@ -174,7 +174,7 @@ discard block |
|
|
block discarded – undo |
174
|
174
|
* @param int $colNum This should be the column number you wish to get (starts at 0)
|
175
|
175
|
* @param array $order This is the order you wish the results to be ordered in should be formatted as follows array('fieldname' => 'ASC') or array("'fieldname', 'fieldname2'" => 'DESC') so it can be done in both directions
|
176
|
176
|
* @param boolean $cache If the query should be cached or loaded from cache set to true else set to false
|
177
|
|
- * @return mixed If a result is found will return the value of the colum given else will return false
|
|
177
|
+ * @return string|false If a result is found will return the value of the colum given else will return false
|
178
|
178
|
*/
|
179
|
179
|
public function fetchColumn($table, $where = array(), $fields = '*', $colNum = 0, $order = array(), $cache = true) {
|
180
|
180
|
$this->buildSelectQuery(SafeString::makeSafe($table), $where, $fields, $order, 1);
|
|
@@ -360,7 +360,7 @@ discard block |
|
|
block discarded – undo |
360
|
360
|
* @param array $where Should be the field names and values you wish to use as the where query e.g. array('fieldname' => 'value', 'fieldname2' => 'value2', etc).
|
361
|
361
|
* @param string|array $fields This should be the records you wis to select from the table. It should be either set as '*' which is the default or set as an array in the following format array('field', 'field2', 'field3', etc).
|
362
|
362
|
* @param array $order This is the order you wish the results to be ordered in should be formatted as follows array('fieldname' => 'ASC') or array("'fieldname', 'fieldname2'" => 'DESC') so it can be done in both directions
|
363
|
|
- * @param integer|array $limit The number of results you want to return 0 is default and returns all results, else should be formated either as a standard integer or as an array as the start and end values e.g. array(0 => 150)
|
|
363
|
+ * @param integer $limit The number of results you want to return 0 is default and returns all results, else should be formated either as a standard integer or as an array as the start and end values e.g. array(0 => 150)
|
364
|
364
|
*/
|
365
|
365
|
protected function buildSelectQuery($table, $where = array(), $fields = '*', $order = array(), $limit = 0) {
|
366
|
366
|
if(is_array($fields)) {
|
|
@@ -466,7 +466,7 @@ discard block |
|
|
block discarded – undo |
466
|
466
|
|
467
|
467
|
/**
|
468
|
468
|
* Returns the limit SQL for the current query as a string
|
469
|
|
- * @param integer|array $limit This should either be set as an integer or should be set as an array with a start and end value
|
|
469
|
+ * @param integer $limit This should either be set as an integer or should be set as an array with a start and end value
|
470
|
470
|
* @return string|false Will return the LIMIT string for the current query if it is valid else returns false
|
471
|
471
|
*/
|
472
|
472
|
private function limit($limit = 0) {
|