Following Uncle Bob\'s avice in Clean Code, I\'d like to have no SQL in my PHP code. Presently I\'m making use of Prepared Statements and I\'ve factored my database access c
What I think you are looking for is a data access layer. I haven't read "Clean Code", but what I'm guessing Uncle Bob is getting at is to not have a bunch of raw SQL and database setup/access code all over the place. Abstract out the database prepare, execute, etc. code into a separate module and work from there.
The comment about using stored procedures is also a good idea IMHO, though this is a highly debated topic with good points on both sides. I tend toward using SP's, but they aren't for everyone or every situation.