4 ms·
After reading the PDO section, I started to wonder if the author has used a language other than PHP. How can PHP have the best database integration if the best
by nemothekid 6y ago
After reading the PDO section, I started to wonder if the author has used a language other than PHP. How can PHP have the best database integration if the best example you can show are simple prepared statements?
- cafard 6y agoWhen I last worked with PHP, I used PDO because it mostly worked like Perl DBI. I agree that it beat using the old mysql interface in SQL-injection mode, but it was by no means a revelation. The Perl DBI has been around since the 1990s: O'Reilly's Programming the Perl DBI came out in 2000.
- wackget 6y ago"Best" is subjective, though, isn't it? What do you regard as being better? Personally I hate frameworks like Zend which abstract database operations into multi-parameter functions. It serves very little purpose when you can just write actual SQL, in my opinion.
- nemothekid 6y agoI'm sure that a lot of other people have great experiences with other database interfaces such as C#'s Linq or Ruby's ActiveRecord, but that really isn't the point of my comment. The PHP snippet in the article is pretty much the bare minimum for SQL integration in other languages. As another reply to my comment points out, the PHP snippet posted is nearly identical to Perl's DBI (which I believe PDO is based on), which came out 1995! For an article that purports "PHP is good now", I wouldn't expect one of the selling points to be something that could be done in (and is routinely done), in Python/Perl/Ruby for over 25 years now.