Difference between revisions of "LSModule:MySQL"
Jump to navigation
Jump to search
Line 52: | Line 52: | ||
* [http://www.lavishsoft.com/downloads/modules/LSMMySQL-20090801.LSModule18.zip LSMMySQL-20090801.LSModule18.zip] | * [http://www.lavishsoft.com/downloads/modules/LSMMySQL-20090801.LSModule18.zip LSMMySQL-20090801.LSModule18.zip] | ||
: Compiled with LSModule v18. Install MySQL.dll to the LavishScript Modules folder. Requires libMySQL.dll be installed | : Compiled with LSModule v18. Install MySQL.dll to the LavishScript Modules folder. Requires libMySQL.dll be installed | ||
− | * [http://www.lavishsoft.com/downloads/modules/libmysql-5.1.zip.zip libmysql-5.1 | + | * [http://www.lavishsoft.com/downloads/modules/libmysql-5.1.zip.zip libmysql-5.1.zip] |
: Don't have libMySQL.dll? Download and extract libMySQL.dll to the Windows System32 folder. | : Don't have libMySQL.dll? Download and extract libMySQL.dll to the Windows System32 folder. | ||
Revision as of 18:03, 11 April 2010
Contents
Overview
This open-source module provides support for MySQL database interaction
Object Types
Example Usage
/* * Require MySQL module during preprocessing, so the variables can be created as part of script structure * instead of using DeclareVariable */ #if !${LavishScript:LoadModule[MySQL](exists)} #error MySQL module for LavishScript required. #endif function main() { variable mysql DB variable mysqlresult Result /* * Connect to db on localhost * user/pass: jimmy/jimmys password * DB name: db_562 */ if !${DB:Connect[localhost,jimmy,jimmys password,db_562](exists)} { echo Could not connect to MySQL database return } /* * SELECT user_id,user_name,user_email FROM table_users * Place result in Result object */ if !${DB:Query["SELECT user_id,user_name,user_email FROM table_users",Result](exists)} { echo Query failed return } while ${Result:FetchRow(exists)} { echo User ${Result.GetString[user_id]}: ${Result.GetString[user_name]} echo -- Email Address: ${Result.GetString[user_email]} } }
Downloads
Ready to Install
- Compiled with LSModule v18. Install MySQL.dll to the LavishScript Modules folder. Requires libMySQL.dll be installed
- Don't have libMySQL.dll? Download and extract libMySQL.dll to the Windows System32 folder.