database connections with PEAR
another way to perform database connections and queries is to use the PEAR:db module. the main benefit of this approach is that it is database-independent so that the functions will work with mysql or with any other type of database. so "fetchRow()" replaces "mysql_fetch_row()".
i decided to use PEAR for my latest project because i think it requires a couple less lines and i like the OO look to it. each web page that makes queries includes the code which contains all the configuration info and which connects to the database. also, each function that performs queries also includes this code. this last bit surely increases overhead but i am not bound to write optimal code.
maybe using PEAR now will get me started on OO-PHP.
i decided to use PEAR for my latest project because i think it requires a couple less lines and i like the OO look to it. each web page that makes queries includes the code which contains all the configuration info and which connects to the database. also, each function that performs queries also includes this code. this last bit surely increases overhead but i am not bound to write optimal code.
maybe using PEAR now will get me started on OO-PHP.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home