How To Use Sql Parameters
I'm trying to create a database for a simple game I'm making and having an issue with querying it for the players stats. So far the database can be searched and updated, but only b
Solution 1:
VALUES is a required part of the INSERT statement.
A parameter marker (?
) just replaces the value itself:
command = ("""
SELECT score FROM players
WHERE username = ?
""")
params = ['John Smith']
return cur.execute(command, params).fetchone()[0]
Post a Comment for "How To Use Sql Parameters"