Psalm 56 and Psalm 34 are actually connected in chronological order. Psalm 56 was written while David was sitting in jail, after being captured by the Philistines in Gath, after he had taken refuge with the enemy. God begins to do some pruning in David’s life while he awaits sentencing, as you can see in 56:3,4 “When I am afraid, I put my trust in you. In God, whose word I praise, in God I trust; I shall not be afraid. What can flesh do to me?” Psalm 34 was penned after David was released and kicked out of Philistia by King Abimelech.