We want to keep our program while connecting to our database safe right ?
No evil doer can get into our database and alter information, cause harm , and possibly costing a lot of money for your company , and as a result compromising your job .
Let me help you , let’s get through some of the steps that we can take to make it safer.
and we keep our bosses happy with our data integrity safe , and secure .
First , let’s look at an example :

This small code that you wrote may seem harmless, and perfectly appropriate for your program correct ?!
🐍🦂🚨 BOOM they got you. The almighty user just got sensitive data because of this innocent code.
Why ? you may ask . well let’s look at the output .
first let’s make a program that depending on what the user is looking for in the database it will display it

ok now let’s run it back . what will be the output

I was looking for London , in the database , and I obtain the information. Hey that’s not secure what if this was sensitive information like bank accounts ! 😱😱😱

Don’t worry let’s re-write our code so it will still be functional , but this time it will hide the output.

Uff , that was close but now our code looks much safer. Beware however, this are but the first steps of something more insidious. SQL Injection !!!
We will also tackle that issue. Thank you for reading. For the complete code please click the link to the repository