#!/usr/bin/env python
import MySQLdb

HOST_NAME = "10.188.53.246"
USERNAME = "dev"
PASSWORD = "dev@mysql5.5"
DATABASE = "recommender"

def GetProductID():
	conn = MySQLdb.connect(host=HOST_NAME, user=USERNAME, passwd=PASSWORD, db=DATABASE)

	cursor = conn.cursor()
	
	cursor.execute("""SELECT DISTINCT ID FROM product WHERE sale_flag = 1 LIMIT 10;""")
	#cursor.execute("""SELECT product.ID, dw_merchandise_base_assort.FIRST_ASSORT_CODE, dw_merchandise_base_assort.SECOND_ASSORT_CODE, dw_merchandise_base_assort.THIRD_ASSORT_CODE FROM product, dw_merchandise_base_assort WHERE dw_merchandise_base_assort.MERCHANDISE_ID = product.ID;""")
	product_table_tuple =  cursor.fetchall()
	#for msg in cursor.fetchall():
		## because type of msg is tuple
	#	print msg[0]
	cursor.close()
	return product_table_tuple
#print GetProductID()
