def update_fuel_value(fuel_value): value_set = [] value_set.append(fuel_value) mysql_cur = mysql_db.get_cursor() query = "UPDATE `vehicle_data` SET `FuelLevel` = %s WHERE VehicleID = 'KA53MB6956'" mysql_cur.execute(query, value_set) mysql_db.commit_data()
def get_current_fuel_value(): mysql_cur = mysql_db.get_cursor() query = "SELECT FuelLevel FROM `vehicle_data` WHERE VehicleID = 'KA53MB6956'" mysql_cur.execute(query) row = mysql_cur.fetchone() return row[0]