Possible Duplicate:
PHP PDO vs normal mysql_connect
So in my application, I accessed the database via a function named db_connect();. Quite simply, it fed the requisite login information and opened a database connection via mysql_connect and mysql_select_db.
Now that I'm working, I have found that the lead programmer uses PDO. Fancy. However, it looks more or less like an object-oriented version of the same thing I used to use.
So what's the difference between doing it the way I used to, or writing a class "db" with a constructor that automatically connects to the database?
In both cases, I'd have to connect to the db/create a new object, which, in either case, takes up one line.
Is it a fancy library to abstract away the nitty-gritty of database connections?
The only thing I can think of is that there's a destructor in the OO version, which means I wouldn't have to code in a "db_close()"...
Edu-ma-cate me! (Please'm)