FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Q: What exactly is PDO?

Feed 4 posts, 3 voices

Avatar
50 posts

What is PDO and why do I need it? In recent versions of frog you have a pdo library for frog, that makes it be able to use PDO. Are there any benefits to using PDO? Currently I have it turned off.

 
Avatar
1493 posts

Hi AJ - Philippe can tell you an technical stuff, and I'm not technically inclined, so I could be getting this wrong! Be that as it may, PDO is a "database abstraction layer" that stands in between (sort of) PHP and the db's that it works with. (Have I got that right?) You can read more here and here and lots of other places, too, I imagine.

I suppose the benefits would come with supporting more than one DB? I know, for instance, that this allows Frog to be used WITHOUT ANY DATABASE! Sort of. :) If you have PHP5+, you don't need mySQL. Pretty nifty, IMO.

I'm sure there's more to be said, but that plumbs the depths of my ignorance!

 
Avatar
1493 posts

OK. I really should not have said "without any database". It's just that with PHP5+ and PDO, you can use SQLite3, which is "internal" to PHP. No other database (like mySQL) required.

 
Avatar
50 posts

Oh, It might be faster because with PDO turned on you are using built in features. I know it is a standard way of communicating with a db but that is about it.

 
Avatar
541 posts

it is not a database abstraction, because it will not change your sql query beetween 2 differents database, but for must of the query you can use it like a database abstraction. PDO mean (PHP Database Object) it is a other way to access database, and I really like the way it works with the preparation od query and then bind you value, that's really nice to code with :)