What is the difference between using pear:DB to connect to a mysql db and using the php mysql functions .?
praVeen
2006-11-30 05:45:56 UTC
what is the advantage of using PEAR:DB over php mysql functions for database operations.
Five answers:
abrockhurst2000
2006-11-30 06:34:54 UTC
The Pear::DB component is an object orientated approach to connecting to databases.
Any database not just MySQL.
For specifically connecting to MySQL, will probably not derive any great benefit.
However, if at some point in the future you decide to switch to PostGREs or DBase, or any of the 10 or so supported databases, using Pear::DB you would not need to re-write your code.
Additional benefits from using Pear::DB are that you can be sure that the DB interface is well written, documented and supported by unit tests, and will work on PHP4 and PHP5.
?
2016-10-16 15:10:19 UTC
there is not any rationalization why the mysql_connect functionality shouldn't paintings see you later because the MySql customer has had the consumer "root" with the password of "definite" defined with the astounding attributes for create, write, examine, execute and probably delete if needed. Extract: handling Databases even with the actuality that each one the database administrative thoughts should be finished through Hypertext Preprocessor scripts, I strongly advise setting up a replica of PHPMyAdmin on your server. it really is an wonderful loose set of scripts which will grant you with an administrative interface on your MySQL database(s). you are able to upload, get rid of, edit, backup and consider your databases utilising this and it really is really functional at the same time as troubleshooting your databases.
?
2006-11-30 07:20:57 UTC
I used PEAR::DB on several Object Oriented projects. The main benefit for me is ease of use and flexibility.
See my answer to this question here for an example of how handy the class can be.