Indigo Rose Software

Professional Software Development Tools

 

View Poll Results: Is this useful?

Voters
1. You may not vote on this poll
  • Yes

    1 100.00%
  • No

    0 0%
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324

    ODBC Plugin: MySQL add-in.

    This is a little plugin that is meant to clip-in to the ODBC action plugin.

    It provides the following functions.
    Code:
    Handle = MySQL.OpenConnection(Server, Username, Password, Port);
    Boolean = MySQL.IsValidHandle(Handle);
    MySQL.Query(Handle, Query);
    Table = MySQL.QueryToTable(Handle, Query);
    MySQL.SelectDatabase(Handle, Database);
    It's meant for ease of use with MySQL databases.

    Example:
    Code:
    -- Open the connection to the database.
    hnd = MySQL.OpenConnection("localhost", "root", "06713502", 3306);
    
    -- Select the database we're going to use.
    MySQL.SelectDatabase(hnd, "test");
    
    -- Query the database.
    result = MySQL.QueryToTable(hnd, "SELECT * FROM `Hello`");
    
    -- Create a string containing the dumped table.
    str = "Dumping table `Hello`..\r\n\tColumns: "..result.Columns.."\r\n\tColumn Names: "..Table.Concat(result.ColumnNames, ", ", 1, result.Columns).."\r\n";
    
    -- Enumerate through the table.
    for K, V in pairs(result.Data) do
    	-- Append to the string.
    	str = str.."\r\nRow #"..tostring(K);
    	
    	-- Go through the row now.
    	for X, Y in pairs(V) do
    		str = str.."\r\n\t"..tostring(X).." = "..tostring(Y);
    	end
    end
    
    -- Show the user.
    Dialog.Message("MySQL Action Plugin", str);
    I've attached the XML and the luac file.

    You can use this add-in by putting the MySQL.luac file in AutoPlay/Scripts then putting the following code in On Preload/Globals/On Startup/...

    Code:
    require "MySQL.luac";
    Last edited by ShadowUK; 09-25-2009 at 11:20 AM.

  2. #2
    Join Date
    Oct 2008
    Posts
    21

    Thumbs up

    Wowww.. Big thk for nice Plugin...

  3. #3
    Join Date
    May 2006
    Posts
    5,380
    why luac ?
    Open your eyes to Narcissism, Don't let her destroy your life!!

  4. #4
    Join Date
    Sep 2008
    Posts
    55
    I get an error because the luac file is looking for:
    C:\Documents and Settings\Stephen Ball\Desktop\Action Plugins\MySQL.lua
    What is this supposed to be?
    Thank you,
    MSP

  5. #5
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Requesting a mod to delete this thread because I need to rethink it.

  6. #6
    Join Date
    Oct 2008
    Posts
    21
    oh sorry for my ninny..

Similar Threads

  1. Example: Using MySQL and AMS
    By Jonas DK in forum AutoPlay Media Studio 7.5 Examples
    Replies: 35
    Last Post: 12-26-2009, 06:13 AM
  2. ODBC Action Plugin for AutoPlay Media Studio
    By Ulrich in forum AutoPlay Media Studio 7.5 Plugins
    Replies: 29
    Last Post: 09-30-2009, 04:22 PM
  3. Security issues regarding the ODBC Action Plugin
    By ShadowUK in forum AutoPlay Media Studio 7.5
    Replies: 6
    Last Post: 02-05-2009, 01:05 PM
  4. Using mysql with ODBC connection
    By jfxwave in forum AutoPlay Media Studio 7.5
    Replies: 7
    Last Post: 08-15-2008, 01:41 PM
  5. INFO: ODBC Configuration Runtime Notes
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-30-2002, 02:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts