Query a site's database
db_queryRun one SQL statement on a site's database, connecting with the site's own credentials (you never need the password). SELECT, SHOW, DESCRIBE and EXPLAIN run straight away in a read-only transaction; anything that changes data needs the user's approval. Remember the table prefix from list_sites.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| why | No | One plain sentence for the user, shown on the approval page if this call needs their approval: what it does and why it is needed. | |
| site | No | Site root folder, like /var/www/shop, or one of the site's domains. Optional when the server has one site (see list_sites). | |
| server | No | Server name or id. Optional when the account has one server. | |
| max_rows | No | Default 200, max 1000. | |
| approval_id | No | Only when repeating a call the user approved. |