King Solomon was inspired by God to say this because King David had taught him to put his trust in God
Trust in the lord
Trust In The LORD Proverbs 3-5. with all thine heart; and lean not unto thine own understanding.
Trust In The Lord With All Your Heart- Proverbs 3-5. Let us learn to trust God in every thing we do. His goodness never ceases.