* @license Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL (http://www.opensource.org/licenses/gpl-2.0.php) licenses.
* Formats a formatted date or datetime to MySQL date or datetime
*
* @param string $string String to format
* @param string $input Input format. May be a default locale (date,time or datetime) or a strptime allowed format {@link http://us2.php.net/manual/en/function.strptime.php strptime}
* @param string $output MySQL output format. May be mysql_date, mysql_time, mysql_datetime or any date allowed format {@link http://us2.php.net/manual/en/function.date.php date}
* Converts a passed in date/time string to timestamp
*
* @param string $string Input string
* @param string $format Input string format. May be a default locale (date,time or datetime) or a strptime allowed format {@link http://us2.php.net/manual/en/function.strptime.php strptime}
if ( $this->query ($query) || ($isupdate && $this->rows_affected == 0))
{
return true;
} else {
return false;
}
}
/**
* Returns an array of database rows, either in object or array format
*
* @param array $queryArray An array containing required statements
* @param constant $output (Optional) Type of rows in the list. May be OBJECT,ARRAY_N (array with numeric index) or ARRAY_A (associative array). Defaults to OBJECT
* @see select_query()
* @see get_results()
* @return array|boolReturns an array with database rows or false on no results
*/
function get_data($queryArray=array(),$output=OBJECT) {
* Returns an array with all rows and colums from a give table
*
* @param string $table Table to use
* @param constant $output (Optional) Type of rows in the list. May be OBJECT,ARRAY_N (array with numeric index) or ARRAY_A (associative array). Defaults to OBJECT
* @see get_data()
* @return array|boolReturns an array with database rows or false on no results
* Works like get_data() but accepts a variable number of strin arguments
* @param mixed $string[, $string2...] Select statements. May be what to select, from which table and where, or just from which table and where. An additional last argument may be the output format
* @see get_data
* @return array|boolReturns an array with database rows or false on no results
* Returns true or number of occurrence of a row if it exists
*
* @param string $table Table name
* @param string|array$field Field to use for search or array with field => fieldvalue
* @param string $value (Optional) Value to search for if $field is a string
* @param string $return (Optional) If set to true will return the number of occurrence of the searched values, else will return just true (defaults to false)
* @see count_rows()
* @return bool|int
*/
function row_exists($table=null,$field,$value="",$return=false)
* Returns an array of database rows from bound table
*
* If no params are passed in all rows from the bound table are returned as an array of objects
* @param array $array (Optional) An array containing select statements
* @param constant $output (Optional) Type of rows in the list. May be OBJECT,ARRAY_N (array with numeric index) or ARRAY_A (associative array). Defaults to OBJECT
* @see get_data()
*
* @return array|boolReturns an array with database rows or false on no results
*/
function select_rows($array=array(),$output=OBJECT) {
* Returns true or number of occurrence of a row if it exists
*
* @param string $val Value to search for
* @param string $col (Optional) Field to use for search. Defaults to primary key of bound table
* @param string $return (Optional) If set to true will return the number of occurrence of the searched values, else will return just true (defaults to false)
* @return bool|int
*/
function exists($val='',$col=null,$return=false) {
//if (empty($col) || !array_key_exists($col,$this->current_table)) {TODO:see type description above