I would use:
SQL |
$_sql = $_sql + " FROM cachesall WHERE $_Where AND cachetype='$Type' " |