20120425

Which databases supported by PHP?


PHP Data Objects (PDO) was introduced back with the 5.1 release of PHP.

PDO creates a consistent, abstracted interface to database servers and data.
PHP offers several database-specific drivers for both PDO and non-PDO access.
The PHP web site contains a list with the latest information about databases that can be integrated along with the PDO abstraction layer and other abstraction layers.

HERE WE ARE FOCUSING ONLY "MYSQL" DATABASE.

Reference: www.php.net/pdo for more info.....

Why a Database?


If you’re developing a PHP application using content / data, you’re likely to need a database. Even for  something small, like a personal blog, you want to think hard about the advantages of using a database instead of static pages or included text files.

Maintainability and scalability

Having PHP assemble your pages on the fly from a template and a database is an addictive experience. Once you enjoy it, you’ll never go back to managing a static HTML site of any size. For the effort of programming one page, you can produce an infinite number of uniform pages. Change one, and you’ve changed them all.

There are now web sites with hundreds of thousands of separate pages — you can rest assured that no one is maintaining them all by hand. If you have a web site that may eventually grow to more than a few dozen pages, you should think about moving to a database sooner rather than later.

Portability

Because a database is an application rather than a part of the operating system, you can easily transfer its structure and contents from one machine to another or (in certain cases) even from one platform to another. This is especially valuable for contractors, who may develop a project without being able to control the environment in which it will eventually be deployed — they can deliver a package of PHP plus a MySQL database schema dump.

Avoiding awkward programming

Certain things can be done with PHP but probably shouldn’t, because they entail ugly or risky programming moves. Say that you happen to be the commander of the "Airbus 787"  and are keeping a captain’s log. Each log entry is contained in a text file identified by its unique stardate, which is plugged into a template by PHP — but hey, you’re a busy spaceman with whole galaxies to explore; you don’t always have time to write in your log every day. You want to put automatically generated Next and Previous links on each page for those who wish to read in straight chronological order. It’s pretty easy to use PHP to find the previous stardated entry, but any attempt to locate the next entry can quickly become an infinite loop — because it’s easier to prove something does exist than that it doesn’t. On the other hand, if you put your log data in a database, the whole job becomes trivial.

The database will tell you which is the latest entry at any given moment. There are other types of programming tasks that a database is highly optimized to do, and given the option, you should take advantage of it to perform these chores. For instance, you should avoid sorting data sets on the PHP side in favor of writing queries so the data is returned presorted. Searching Although it’s possible to search multiple text files for strings (especially on Unix platforms), it’s not something most web developers will want to do often. After you search a few hundred files, the task becomes slow and hard to manage.

In some cases, information attains value only when put into a searchable database. For instance, relatively few people would want to read a long text list of movie directors and their films, but many might occasionally want to search a database of that information. You could argue that it’s the searchability, as much as the information itself, that creates the value here.

What Is a Database?


A database is a collection of data. The term database usually indicates that the collection of data is stored on a computer.  Database applications are useful to manage the data stored in the computer. The database applications are useful to, how the actual data is stored and retrieved. Some database applications are MySQL, MSSQL and oracle.

College databases is stored and mainated in a server called database server. A database server is a database application built with multiple users in mind. Most of the time when programming PHP you’ll be accessing a database server. Some database servers include PostgreSQL, MySQL, Microsoft’s SQL Server, and the Oracle suite of databases. Some database servers called RDBMS, which is an acronym for relational database management system.
Database servers usually have one or more distinct APIs for programmatically creating, accessing, managing, searching, and replicating the data they hold. It is through the API that you connect to and work with data stored in database servers when using PHP.

There is no requirement that an RDBMS be used to store data. Other data stores can be used such as a flat file or a table known as a hash table. These are perfectly fine for some applications, especially smaller applications; however, for larger applications or applications that require optimal speed for large data stores, an RDBMS is a requirement.