#!/usr/local/bin/python

# Import the modules
import mSQL, MySQL;

database = 'db_test';
query = 'SELECT test_id, test_val FROM test';

# Connect to the servers
msql = mSQL.connect();
mysql = MySQL.connect();

# Select the test databases
msql.selectdb(database);
mysql.selectdb(database);

# Run the query
m_result = msql.query(query);
my_result = mysql.do(query);

# Process the results from mSQL
for row in m_result:
    # Here, row is a tuple
    print "mSQL- test_id: ",row[0]," | test_val: ",row[1];

# Process the results from MySQL
for row in my_result:
    # Here, row is a list
    print "MySQL- test_id: ",row[0]," | test_val: ",row[1];

# Close the connections (mSQL only)
msql.close();
