> For the complete documentation index, see [llms.txt](https://docs.clipbucket.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clipbucket.com/fundamentals/basic-understandings/db.class-and-functions.md).

# DB.class & Functions

```
//Class is initated as  $cbtpl
$db->select($query);
```

Absolute Path of the Class File **/includes/classes/db.class.php**

Absolute Path of the functions file **/includes/functions\_db.php**

| Object Methods                              | Functions                                      | Purpose                                                                                    |
| ------------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------ |
| **::**\_select($query)                      | db\_select($query)                             | Executes a MYSQL query and return ARRAY                                                    |
| ::select($tbl, $fields, $condition, $order) |                                                | <p>Executes Mysql SELECT query and returns data.</p><p></p>                                |
| ::db\_update                                | db\_*update($tbl, $assoc\_fields, $condition)* | Update a DB table and set values acording to the Assoc\_array fields and as per $condition |
| ::db\_insert                                | db\_insert($tbl, assoc array $fields)          | Insert data into a table                                                                   |
| ::insert\_id                                |                                                | returns last insert\_id                                                                    |
| ::Execute()                                 |                                                | Executes a raw Mysql Command                                                               |
