Prev | Current Page 170 | Next

Hasin Hayder

"Object-Oriented Programming with PHP5"


Database in an OOP Way
Besides regular improvements in the OOP, PHP5 also introduces many new libraries
to seamlessly work with database in an OOP way. These libraries provide you with
improved performance, sometimes improved security features, and of course a
whole lot of methods to interact with new features provided by the database server.
In this chapter we will discuss MySQL improved API, which is known as MySQLi.
Take a look at basic PDO (well, not detailed because PDO is so huge that it is
possible to write a whole book just on it), ADOdb, and PEAR::MDB2. In the mean
time we will also take a look at Active Record pattern in PHP using ADOdb's active.
One thing to note here is that we are not focusing on how to do general database
manipulations. We will only focus on some specific topics which are interesting for
PHP developers who are doing database programming in an OO way.
Introduction to MySQLi
MySQLi is an improved extension introduced in PHP5 to work with advanced
MySQL features like prepared statements and stored procedures. From a
performance point of view, MySQLi is much better than a MySQL extension. Also
this extension offers completely object oriented interfaces to work with a MySQL
database which was not available before PHP5.


Pages:
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182