def db(t):
conn = MySQLdb.connect (host = "db",
user = "ed",
passwd = "ввв",
db = "ed")
cursor = conn.cursor ()
cursor.execute ("SELECT COUNT(*) FROM table where some < FROM_UNIXTIME(t)")
row = cursor.fetchone ()
print row[0]
cursor.close ()
conn.close ()