public function genQuery ($arrParams = array ())
	{

		// Generate sql query
		
		$strSQL	= $this->genSQL ($arrParams);
		
		// prepare database query
		
		$query = $this->prepare ($strSQL);

		// If there are some WHERE clauses
		
		if (isset ($arrParams['where']) && is_array ($arrParams['where']))
		{

			// Bind WHERE clauses
			
			$this->genBindValues ($query, $arrParams['where']);

		}

		// If there are some HAVING clauses
		
		if (isset ($arrParams['having']) && is_array ($arrParams['having']))
		{

			// Bind HAVING clauses
			
			$this->genBindValues ($query, $arrParams['having']);

		}
		
		// If there are some parameters to bind
		
		if (isset ($arrParams['bind']) && is_array ($arrParams['bind']))
		{

			if (!$this->bindValues ($query, $arrParams['bind']))
			{
				return FALSE;
			}

		}

		// Return query
		
		return $query;

	}