King James Version
And the counsel of Ahithophel, which he counselled in those days, was as if a man had enquired at the oracle of God: so was all the counsel of Ahithophel both with David and with Absalom.English Standard Version
Now in those days the counsel that Ahithophel gave was as if one consulted the word of God; so was all the counsel of Ahithophel esteemed, both by David and by Absalom.New International Version
Now in those days the advice Ahithophel gave was like that of one who inquires of God. That was how both David and Absalom regarded all of Ahithophel's advice.