def showTables(): ret = sql.GetCommand("show tables") if len(ret) == 0: print "No table found!" else: for table in ret: print table return ret
def showInformation(tablename): cmd = "select * from %s" % tablename ret = sql.GetCommand(cmd) if len(ret) == 0: print "No information found in %s" % (tablename) else: for item in ret: print item return ret
def dropTable(): cmd = "drop table test_table" ret = sql.GetCommand(cmd) print ret
def createTable(): cmd = "create table test_table(nid int not null \ auto_increment primary key, num int null)" ret = sql.GetCommand(cmd) print ret