Changes between Version 1 and Version 2 of PhpDb
- Timestamp:
- Nov 2, 2007, 2:26:41 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PhpDb
v1 v2 3 3 BOINC's PHP code uses the following classes for DB access: 4 4 5 Class !DbConn ( html/inc/db_conn.inc) :: Represents a connection to a particular database (not just to a server). The class functions prepend the database name to table names in queries, so there is no confusion if you use multiple databases at once. All MySQL-specific PHP functions (mysql_query(), etc.) are called only from this class.5 Class !DbConn ([source:trunk/boinc/html/inc/db_conn.inc html/inc/db_conn.inc]):: Represents a connection to a particular database (not just to a server). The class functions prepend the database name to table names in queries, so there is no confusion if you use multiple databases at once. All MySQL-specific PHP functions (`mysql_query()`, etc.) are called only from this class. 6 6 7 Class !BoincUser, !BoincTeam, etc. ( html/inc/boinc_db.inc) :: Each class represents a particular table in the BOINC database, and provides functions for selecting, inserting, updating and enumerating rows.These functions take care of initializing the !DbConn layer - you don't have to do this directly.7 Class !BoincUser, !BoincTeam, etc. ([source:trunk/boinc/html/inc/boinc_db.inc html/inc/boinc_db.inc]):: Each class represents a particular table in the BOINC database, and provides functions for selecting, inserting, updating and enumerating rows. These functions take care of initializing the !DbConn layer - you don't have to do this directly. 8 8 9 9 All PHP code should use these classes exclusively for accessing the DB. … … 13 13 This is divided into: 14 14 15 * Code with direct mysql_*() calls, and with calls to db_init().16 * The message-board code ( forum_*), which has a separate and more heavyweight abstraction layer.Eventually this code should be converted to use the new abstraction layer.15 * Code with direct `mysql_*()` calls, and with calls to `db_init()`. 16 * The message-board code (`forum_*`), which has a separate and more heavyweight abstraction layer. Eventually this code should be converted to use the new abstraction layer.