[Tutorial] How to use SQLite
#4

You should. I will give you an example of what SQL Injection is.

Let's say your mode has a dialog (input) and someone insert a "name" to check something for a user. He can input:
pawn Code:
"Zeus';DROP TABLE users;"
And it will just delete your table "users". DB_Escape is used for this reason. To prevent someone from doing something bad to your database. You can also read more about DB_Escape/SQL Injection to the wiki (https://sampwiki.blast.hk/wiki/Escaping_Strings_SQLite) or wikipedia (http://en.wikipedia.org/wiki/SQL_injection)

You just need to check any string you insert in a query with:
pawn Code:
// An example:
"SELECT username FROM users WHERE ip = '%s'", DB_Escape( ip ) // etc..
Glad to hear that you use SQLite, it's great and I can confirm it because I know that a very popular server in the past used SQLite and had over 500,000 registered users and everything worked fine!

Thanks for your kind words.
Reply


Messages In This Thread
How to use SQLite - by Konstantinos - 09.07.2013, 11:11
Re: How to use SQLite - by Konstantinos - 09.07.2013, 11:35
Re: How to use SQLite - by Niko_boy - 09.07.2013, 12:18
Re: How to use SQLite - by Konstantinos - 09.07.2013, 12:31
Re: How to use SQLite - by Yordan_Kronos - 09.07.2013, 13:09
Re: How to use SQLite - by DaRk_RaiN - 09.07.2013, 13:26
Re: How to use SQLite - by StreetGT - 09.07.2013, 13:28
Re: How to use SQLite - by Konstantinos - 09.07.2013, 13:40
Re: How to use SQLite - by Red_Dragon. - 09.07.2013, 15:34
Re: How to use SQLite - by Zeyo - 09.07.2013, 16:37
Re: How to use SQLite - by Konstantinos - 09.07.2013, 16:41
Re: How to use SQLite - by Konstantinos - 09.07.2013, 18:37
AW: How to use SQLite - by IPrototypeI - 09.07.2013, 19:09
Re: How to use SQLite - by Konstantinos - 09.07.2013, 19:47
Re: How to use SQLite - by NoahF - 09.07.2013, 22:36
Re: How to use SQLite - by Konstantinos - 10.07.2013, 08:49
Re: How to use SQLite - by RedFusion - 10.07.2013, 21:26
Re: How to use SQLite - by Darnell - 12.07.2013, 02:04
Re: How to use SQLite - by Konstantinos - 12.07.2013, 10:50
Re: How to use SQLite - by Kaperstone - 16.07.2013, 16:01
Re: How to use SQLite - by jozzuia - 17.07.2013, 05:11
Re: How to use SQLite - by Konstantinos - 19.07.2013, 11:32
Re: How to use SQLite - by Avi Raj - 27.11.2013, 15:28
Respuesta: How to use SQLite - by CrossOv3r - 19.12.2013, 22:40
Re: How to use SQLite - by Konstantinos - 23.12.2013, 10:08
Re: How to use SQLite - by ZBits - 25.12.2013, 22:37
Re: How to use SQLite - by Pottus - 25.12.2013, 23:05
Re: How to use SQLite - by JoeMercury - 07.05.2014, 09:31
Re: How to use SQLite - by Konstantinos - 07.05.2014, 13:37
Re: How to use SQLite - by JoeMercury - 07.05.2014, 16:17
Re: How to use SQLite - by Affan - 08.05.2014, 03:11
Re: How to use SQLite - by JoeMercury - 08.05.2014, 09:30
Re: How to use SQLite - by Joron - 19.01.2016, 21:17
Re: How to use SQLite - by Black Axe - 09.04.2016, 06:18
Re: How to use SQLite - by iKevin - 09.04.2016, 07:20
Re: How to use SQLite - by Konstantinos - 09.04.2016, 11:39
Re: How to use SQLite - by HydraHumza - 09.04.2016, 18:57
Re: How to use SQLite - by GhostHacker - 16.04.2016, 03:31
Re: How to use SQLite - by Konstantinos - 16.04.2016, 08:40
Re: How to use SQLite - by JaKe Elite - 04.05.2016, 09:56
Re: How to use SQLite - by Konstantinos - 04.05.2016, 10:16
Re: How to use SQLite - by SyS - 29.05.2016, 05:56
Re: How to use SQLite - by Konstantinos - 29.05.2016, 14:21
Re: How to use SQLite - by Roozevelt - 29.05.2016, 14:31
Re: How to use SQLite - by Konstantinos - 29.05.2016, 15:02
Re: How to use SQLite - by Roozevelt - 30.05.2016, 14:16
Re: How to use SQLite - by Arbico - 23.10.2017, 08:13
Re: How to use SQLite - by xMoBi - 23.10.2017, 08:51
Re: How to use SQLite - by dani18 - 18.01.2018, 20:00
Re: How to use SQLite - by PlayHard - 05.05.2018, 03:38
Re: How to use SQLite - by xMoBi - 10.08.2018, 08:59
Re: How to use SQLite - by Banditul18 - 10.08.2018, 09:10
Re: How to use SQLite - by SapMan - 24.12.2018, 22:16

Forum Jump:


Users browsing this thread: 1 Guest(s)