I'm trying to select some data from my table using Python, but each time I have a new value to select using a list. Here is my table.
CREATE TABLE IF NOT EXISTS stops (
stop_id varchar(3) PRIMARY KEY,
stop_code varchar(10),
stop_name varchar(30),
stop_desc varchar(10),
stop_lat varchar(20),
stop_lon varchar(20),
zone_id varchar(20),
stop_url varchar(20),
location_type varchar(20),
parent_station varchar(20)
)
I tried to select data using this code.
mycursor.execute("SELECT stop_id FROM stops where stop_name=station")
stopid = mycursor.fetchone()
Where station
is a variable that i've been using all long the code.