Jump to content
MakeWebGames

Is this a good way to defend against SQL injections?


Recommended Posts

Posted

To add on,

You are only filtering for given character values in your string. While you maybe eliminating character values that are used in an SQL injection, what a_bertrand said is much more efficient and clean. Also, since I see that you are using this in some sort of message query, you are going to strip possible characters that the user would use normally in the chat, such as a question mark, period, etc. That is not ideal at all.

Posted (edited)

Labas... Ok i know ths is is offtopic.. but how do you send message for someone on this site?? Cant find link anywhere (I just want to PM the starter, so thought it would be appropiate to post it here lol)

And on topic: I wouldn't use Lithuanian in your code.. ;) English is more universal.. and what if your game ever becomes big an popular, and you will want to hire a non-Lithuanian dev??

Edited by galdikas

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...