views:

56

answers:

2

I am really new to drupal and new to php. I have some questions. Suppose I have a drupal and a server running on my local machine, how does drupal interact with database? (database is mysql) it doesn't matter which version of drupal it is, I just want to know how drupal interacts with database.

Thank you!

+2  A: 

Just like any other web application with SQL. The connection string is defined in settings.php and using this authentication Drupal's Database API interacts with SQL.

Kevin
A: 

Drupal uses a database abstraction layer to interact with databases. Currently only MySQL and PostgreSQL is supported as far as I know. You can read more about the available functions in the database abstaction layer here http://api.drupal.org/api/group/database/6.

Wikipedias explanation of database abstraction layer sums it up well:

Traditionally, all database vendors provide their own interface tailored to their products which leaves it to the application programmer to implement code for all database interfaces he would like to support. Database abstraction layers reduce the amount of work by providing a consistent API to the developer and hide the database specifics behind this interface as much as possible.

Source: http://en.wikipedia.org/wiki/Database_abstraction_layer

Erik Töyrä