Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/01/2010, 09:46
Fenris
 
Fecha de Ingreso: agosto-2008
Mensajes: 271
Antigüedad: 15 años, 9 meses
Puntos: 2
Respuesta: fetchAll -> mysql_fetch_object ?

fetchAll

Código:
				
$query = 'SELECT * FROM dbTable';

				$rs= $this->db->query($query);  
					
					if ($this->db->numRows($rs) > 0)
					{
							return $this->db->fetch_object($rs);
							
					}
db.query
Código:
if ($resultSet = mysql_query($sqlQuery, $this->idConnection)){ //si se ejecuto exitosamente la query la retorno
			$this->lastResultQuery = $resultSet;
			return $resultSet;
db.fetch

Código:
	public function fetch($resultSet, $type='')
	{
		($type==='') ? $this->type = db::DB_BOTH : $this->type = $type;
		
		if (!$this->idConnection){
			$this->connect_db();
				if (!$this->idConnection){
					return false;
				}
		}
		
		if (!$resultSet){
			$resultSet = $this->lastResultQuery;
			if (!resultSet)
			{
				return false;
			}
		}
		return $this;
	}
db.fetch_object

Código:
	public function fetch_object($resultSet=''){

		if(!$this->idConnection){
			return false;
		}
		if(!$resultSet){
			$resultSet = $this->lastResultQuery;
			if(!$resultSet){
				return false;
			}
		}
		
		$data = new stdClass();
		
		while ($rowSet = mysql_fetch_object($resultSet))
		{
			$data = $rowSet;
		}

		return $data;		

	}