Differences

This shows you the differences between two versions of the page.

Link to this comparison view

modules:mysql [2011/09/08 16:07] (current)
Line 1: Line 1:
 +====== 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)