$db.query
Execute the SQL query
Note: $db.query method is available in the Advanced Edition only.
Syntax:
$db.query( db-name, sql)
Parameters:
db-name – database name defined at [Configuration] > [Advanced] page (Refer toExecute SQL query from Dialplan)
sql – an SQL statement
Returns:
a result of the query. if multiple columns are returned, use $db.get to get a column value.
Version Since:
2.4
Example:
$db.query("mydb", "SELECT value FROM table WHERE key='%1')") = (.+)
Execute SELECT statement on the databse “mydb”.