webCOMAND

#SQLDB

Sets the database all #SQL statements will query inside the #SQLDB block.

Prototype

#SQLDB($type, $host, $name, $username, $password) ... #ENDSQLDB

Parameters

  • type - The database type.  Options include:
    • mysql - MySQL or MariaDB
    • oci - Oracle
    • odbc - ODBC v3 (ie. Microsoft SQL Server, IBM DB2)
    • pgsql - PostgreSQL
    • sqlite - SQLite
  • host - "localhost" when the database is hosted on the same server, otherwise the hostname or IP address of the remote server.
  • name - Name of the database
  • username - Username to access the database.
  • password - Password to access the database.

Example

#SQLDB("mysql","localhost","address_book","user","pass")
#SQL($Results,"SELECT Name FROM contacts")
#LIST($Results)
$Name<br />
#ENDLIST
#ENDSQLDB

Related

#SQL