To access external SQL databases from Totum, you need to fill in the database access details in the ttm__external_databases
table.
The strEncrypt function is used to save and read passwords. To use it, you need to create a Crypto.key
file in the root of the Totum installation with the encryption key.
name
— unique name of the database connection.
type
— PDO type.
For MySQL
, you need to install the PHP
module: apt -y install php8.0-mysql
host
— the host of the database to which you need to connect. For a remote database, you need to ensure port access and allow remote connections for the host, user, and database.
port
— connection port.
database_name
— name of the database.
username
— username.
user_pass
— password. Set via set_pass
.
options
— PDO options for the connection.
proDbConnect — connection.
proDbDisconnect — disconnection.
proDbExecQuery — execute query
without returning data.
proDbSelect — execute query
with returning row
.
proDbSelectList — execute query
with returning rowList
.