fishbones/core/DB.php
/**
	 * executeas a sql and return result as array
	 *
	 * @param	string $sql	sql query
	 *
	 * @return	array|boolean	numeric indexed array of associative arrays with
	 * 					data value pairs, 
	 *					array with one element, empty array in case of sucess but no resulset
	 *					this cast to boolena true, and iterations do nothing
	 *					boolean false on error
	 * 
	 */
executeas a sql and return result as array

@param       string $sql     sql query

@return      array|boolean   numeric indexed array of associative arrays with
data value pairs,
array with one element, empty array in case of sucess but no resulset
this cast to boolena true, and iterations do nothing
boolean false on error
executeas a sql and return result as array @param string $sql sql query @return array|boolean numeric indexed array of associative arrays with data value pairs array with one element empty array in case of sucess but no resulset this cast to boolena true and iterations do nothing boolean false on error
public function queryAsArray( $sql ) {
		$this->error = '';
		Fishbones::getLog()->writeSql( $sql );
		$res = mysql_query( $sql, $this->conex );
		if( !$res ) {
			$this->transactionStarted? $this->rollBack() : null ;
			$error = "database query error";
			$this->error = $error;
			Fishbones::getLog()->writeDatabaseError($error);
			Fishbones::getLog()->keepLog();
			return false;
		}
		if ( is_resource( $res ) ) {
			$this->resul = array();
			while ( $assoc = mysql_fetch_assoc( $res ) ) {
				$this->resul[] = $assoc;
			}
			return $this->resul;
		}
			$this->resul = array();
			return $this->resul;
	}
public function queryAsArray ( $ sql ) { $ this -> error = '' ; Fishbones :: getLog ( ) -> writeSql ( $ sql ) ; $ res = mysql_query ( $ sql , $ this -> conex ) ; if ( ! $ res ) { $ this -> transactionStarted ? $ this -> rollBack ( ) : null ; $ error = " database query error " ; $ this -> error = $ error ; Fishbones :: getLog ( ) -> writeDatabaseError ( $ error ) ; Fishbones :: getLog ( ) -> keepLog ( ) ; return false ; } if ( is_resource ( $ res ) ) { $ this -> resul = array ( ) ; while ( $ assoc = mysql_fetch_assoc ( $ res ) ) { $ this -> resul [ ] = $ assoc ; } return $ this -> resul ; } $ this -> resul = array ( ) ; return $ this -> resul ; }
executeas a sql and return result as array
executeas a sql and return result as array
// query error // query sucess with reults // revised: just return an array // query sucess with no resulset // empty array cast to boolean false // so return array with one element. empty array, to make function result cast to true  //if ( $res == true ) { //if ( $res == true ) { //$this->resul[] = array(); //}