MySQL

Function:
mysql.connect(host, database, user, [password])
Connects/reconnects to the server
Function:
mysql.query(handle, sqlstr)
Send command to mysql server
Function:
mysql.dbs(handle)
Get a list of the databases
Function:
mysql.tables(handle)
Get a list of the tables
Function:
mysql.fields(handle, table)
Get a list of the fields of a table
Command:
mysql.disconnect handle
Disconnects
Command:
mysql.use handle, database
Changes the current database

Example:

h = mysql.connect("localhost", "mydatabase", "user", "password")
put "Handle = "; h
put "DBS    = "; mysql.dbs(h)
put "TABLES = "; mysql.tables(h)
put "Query  = "; mysql.query(h, "select * from sbx_counters")
mysql.disconnect h

modules/mysql.txt · Last modified: 2011/09/08 16:07 (external edit)