Hai messo $data tra apici? dovrebbe essere

WHERE '$data' BETWEEN dal AND al