I've had a look at this solution here. But I don't quite fully understand what is going on, hence I don't know how to use a similar technique in my code.
order = "Movies.Rating_IMDB ASC"
general = db.execute (
"""
SELECT Movies.Movie_ID, Movies.Name, Movies.Year, Movies.Image
FROM Movie_Genre
JOIN Movies ON Movie_Genre.Movie_ID = Movies.Movie_ID
JOIN Genres ON Movie_Genre.Genre_ID = Genres.Genre_ID
WHERE Genres.Genre = ?
ORDER BY ?;
""",
(str(selectedGenre), order,)
)
basic = general.fetchall()
{}in the code you've shown.