All pastes #103160 Raw Edit

Someone

public text v1 · immutable
#103160 ·published 2006-07-28 04:08 UTC
rendered paste body

	function get_all( $offset, $max_rec = 10, $orderby = "date_started", $direction = "DESC")
	{
		$query = "SELECT f.id, f.date_started, f.manager_id, f.status, u.realname
					FROM spr_form as f, users as u
					WHERE u.ID = f.manager_id
					ORDER BY f.$orderby $direction, f.id DESC
					LIMIT $offset,$max_rec";
		$stmt = $this->dbh->prepare( $query );
		$stmt->execute("");
		if( $stmt->num_rows() )
		{
			while( $row = $stmt->fetch_array() )
			{
				$data[] = $row;
			}
			return $data;
		}
		return false;
	}