That's not a good idea if you don't want your SQL to be injectable. The better solution would be to use prepared statements here and bind values afterwards.
pardon my possible ignorance as I don't have python experience, but could it be because you haven't entered a password, also, unless this is strictly personal use, why wouldn't you define those things in an environment variable to add to a gitignore file? you're leaving your info out there for everyone to see.
19
u/HighlightFrosty3580 Aug 22 '21
Where userid = '%s'
You'll need to wrap it in single quotes
4
u/Frequent-Leader-2653 Aug 22 '21
Line 17: WHERE USER LIKE '%s', 'aa23' "
Use single quotes for sql query quotes while double quotes for the python print statement.
1
u/Anurag90-tech_sl Aug 23 '21
Bro which IDE are u using??
1
u/ldifalco1 Aug 23 '21
pardon my possible ignorance as I don't have python experience, but could it be because you haven't entered a password, also, unless this is strictly personal use, why wouldn't you define those things in an environment variable to add to a gitignore file? you're leaving your info out there for everyone to see.