开发者

How does drupal connect to the database

开发者 https://www.devze.com 2023-01-06 07:03 出处:网络
I am really new to drupal and new to php. I have some questions. Suppose I h开发者_运维百科ave a drupal and a server running on my local machine, how does drupal interact with database? (database is m

I am really new to drupal and new to php. I have some questions. Suppose I h开发者_运维百科ave 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!


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号