this question has answer here:
- executing “select … … in …” using mysqldb 10 answers
i have written python script grabs specific data table , displays data. following script:
import mysqldb import os,sys path="c:/python27/" conn = mysqldb.connect (host = "localhost",user = "root", passwd = "cimis",db = "cimis") c = conn.cursor() station=[2,80,7] date="8/1/2016" hour=[200,300,400] message = """select stationid,date,hour,airtemperature cimishourly stationid in %s , date=%s , hour in %s""" c.execute(message,(station,date,hour)) result=c.fetchall() row in result: print(row) conn.commit() c.close()
when create list of station ids,it works fine showing output on cmd. when add list of hours, script runs without error no output seen on cmd. please me out .thank you
i suspect aren't believing database telling you, namely there aren't rows meet search criteria.
Comments
Post a Comment