David did what God commanded him to do. So David and his men defeated the Philistine army. They killed the Philistines all the way from Gibeon to Gezer.