# Getting values from the database

## Type: expression

## Syntax:

```
[sqlsk] mysql %database object% query %query% and get [string] %string%
```

## Examples:

Table **Kings**

| kingid | name     |
| ------ | -------- |
| 1      | Noob     |
| 2      | Notch    |
| 3      | Jeb\_    |
| 4      | ProGamer |

```java
 set {_db} to mysql conn for "localhost;minecraft;admin;secretpass"
 set {_q::*} to mysql {_db} query "SELECT * FROM `kings`" and get "name"
 send "All kings: %{_q::*}%" to all players
 // It send: All kings: Noob, Notch, Jeb_ and ProGamer 
```


---

# 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://arinem.gitbook.io/sqlsk/docs/getting-values-from-the-database.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.
