import mysql

def GetTable(addr, id, pwd, db, tbl):
	sql = mysql.Client()

	sql.Connect(addr, id, pwd, db)
	sql.Query("SELECT * FROM %s" % (tbl))

	res = sql.GetResult()

	fields = []
	while res.FetchField():
		fields.append(res.GetFieldName())

	rows = []
	while res.FetchRow():
		rows.append(res.GetRow())

	sql.Close()

	return (fields, rows)

