# 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                                                               |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.clipbucket.com/fundamentals/basic-understandings/db.class-and-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
