News for hackers. Stuff that matters.
Re:PHP to deprecate MySQL extension by preek on Friday July 15, 2011 @01:05PM (#2768179)
Two things sometimes irk me: How much code there is to write for simple DB interaction + coupling of two different languages (SQL + [programming lang]).

In Rails I'd write:

  Folk.create(:name => some_name, :addr => some_addr, :city => some_city)
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?

Re:PHP to deprecate MySQL extension by smackfu on Friday July 15, 2011 @02:34PM (#2768519)
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.
Re:PHP to deprecate MySQL extension by 1880 on Friday July 15, 2011 @01:25PM (#2768269)
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.

Re:PHP to deprecate MySQL extension by mh- on Friday July 15, 2011 @03:14PM (#2768661)
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.

Re:PHP to deprecate MySQL extension by duskwuff on Friday July 15, 2011 @01:09PM (#2768187)
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.