From: Matthew M. <ma...@tu...> - 2006-04-12 19:00:12
|
> I've been wondering the same thing about PHPWS_Database / PHPWS_DB. No > big deal, really -- just an intellectual curiosity. 1) Security - db class attempts to strip unfriendly elements 2) Ease of use - sometimes it is easier to write a quick sql query. A majority of the time however I find it easier to use my class. Setting multiple values and using ->update() is much easier that creating the query with sprintf. Also, it is easier to have conditionals shape the query in the db object (i.e. if ($foo) $db->addWhere('foo', 1);) 3) Less error - I tend to not have to worry about typos and form when using the object over raw queries. Also, I find it easier to bug check my code using the db object than to look over a raw query. 4) Multiple DB PEAR compatibility - running under different databases is not as easy as piping information into the pear class. It sometimes requires some massaging. 5) Error checking - Easier to control and log errors using the class. 6) Table prefixing - Unfortunately, still requested. Again easier to manage in the class. 7) Connecting - Do you really want to pipe in the DSN everytime you make a db connection? 8) Formatted results - getObjects, loadObject and saveObject are great time savers in my opinion. setIndexBy is nice as well. 9) Salary - I get paid per line of code. -- Matthew McNaney Electronic Student Services Appalachian State University http://phpwebsite.appstate.edu |