As everyone already suggested here you need to implement ORM. See this question to choose: Good PHP ORM Library?Good PHP ORM Library?
If you still don't want to use ORM you will need to implement the same thing by itself, this will take more time than using ready-to-go ORM. You could implement Unit of work (http://martinfowler.com/eaaCatalog/unitOfWork.html ) and Repository (http://martinfowler.com/eaaCatalog/repository.html) patterns to build you own ORM.