It's only "one language" because the Rails framework is hiding the SQL away from you. You can bolt a framework on top of PHP too.
Well, if you use a PHP framework or library, of course there are easier and less verbose ways to prepare SQL statements.
I don't think RoR vs PHP would be an apples to apples comparison.
this reply isn't meant to be a flame, but-
Do you not understand why you can't compare Rails (framework) to PHP (language)?
PHP has frameworks with ORM, too.
ActiveRecord is an abstraction. Which is good in general, but when you want to get your hands dirty with some SQL it's a pretty serious hindrance.
Re:PHP to deprecate MySQL extension
by wavesplash on Friday July 15, 2011 @01:49PM
(#2768365)
ActiveRecord lets you write raw sql any time you need to. AR's design goal was to just reduce the drudgery, not prevent you from using the full power of sql.
No 'serious hindrance' involved.
In Rails I'd write:
One line, easily readable and only one language (Ruby).This is not meant to be a flame post - I'm just asking: Is it the preferred way in PHP to prepare SQL statements yourself?