private function RemoveWherePrefix($sql)
	{
		$sql = trim($sql);
		
		// remove if the query is surrounded by parenths
		while (substr($sql,0,1) == "(" && substr($sql,0,-1) == ")")
		{
			$sql = trim( substr($sql,1,-1) );
		}
		
		while (strtolower( substr($sql, 0, 5) ) == "where")
		{
			$sql = trim(substr($sql,5));
		}
		
		return $sql;
	}
private function RemoveWherePrefix($sql)
	{
		$sql = trim($sql);
		
		// remove if the query is surrounded by parenths
		while (substr($sql,0,1) == "(" && substr($sql,0,-1) == ")")
		{
			$sql = trim( substr($sql,1,-1) );
		}
		
		while (strtolower( substr($sql, 0, 5) ) == "where")
		{
			$sql = trim(substr($sql,5));
		}
		
		return $sql;
	}
private function RemoveWherePrefix ( $ sql ) { $ sql = trim ( $ sql ) ; // remove if the query is surrounded by parenths
 while ( substr ( $ sql , 0 , 1 ) == "(" && substr ( $ sql , 0 , - 1 ) == ")" ) { $ sql = trim ( substr ( $ sql , 1 , - 1 ) ) ; } while ( strtolower ( substr ( $ sql , 0 , 5 ) ) == "where" ) { $ sql = trim ( substr ( $ sql , 5 ) ) ; } return $ sql ; }
Removes the "where" from the beginning of a statement
@param string partial query to parse
@return string query without the preceeding "where"
Removes the where from the beginning of a statement