I want to build a PHP web application, but always faces the problem that I need to connect to database and deal with related objects. So I tried codeigniter and it uses a special way to connect to database named Active Record and I've known that its an ORM technique and there are lot of ORM libraries out there.

What is the best, the easiest and the fastest of them?

  • I am in a bind with similar questions. I have come to the conclusion that we need to build our own in house framework and tools to consolidate all our projects and I'm swinging towards the j2EE direction but I'd rather stay on php. However I have no knowledge of php enterprise solutions on hand. Good question – Dark Star1 Nov 28 '11 at 0:28

RedBean is what I use for such purpose: http://redbeanphp.com/

RedBean eases the development phase with automatic schema modifications, on the fly. it works very well with MySQL and SQLite but other databases supported by PDO should work too.

|improve this answer|||||
  • so.. did you try another ORM library ? – Emad Elsaid Nov 20 '10 at 15:57
  • I used to use Doctrine 1.x, but had enough of its quirks, bloat and poor performance. This may not apply to 2.x, but I didn't use it. – desfrenes Nov 20 '10 at 21:16

Doctrine and Propel are two popular ORMs. Personally I only have experience with Doctrine and have no complaints.

You should also read through the answers to this question on StackOverflow.

|improve this answer|||||
  • the other question on stackoverflow is useful thanks. – Emad Elsaid Nov 20 '10 at 16:01

I really have to sing praise for PHP.ActiveRecord. It's nearly a direct clone from Rails' ActiveRecord ORM. It has been nothing but awesome for me an is relatively painless to integrate into modern frameworks.

Both developers are regularly available on their support forums to give help to those in need.

It's a brilliant project and I highly recommend it - especially if you're from a Rails background.

|improve this answer|||||
  • +1 second paragraph is key – Dan Rosenstark Dec 25 '10 at 18:27
  • This is no longer developed. – transilvlad Feb 24 '15 at 9:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.