Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts

    How to protect against SQL Injection from hackers?

    What would you guys suggest to prevent SQL injections?

    Is there something you would strongly advise me to do?

    Thanks

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,111
    Thanks
    75
    Thanked 4,333 Times in 4,299 Posts
    What kind of server-side language are you using? What kind of database?

    If you are using PHP with MySQL, then look into mysql_real_escape_string() -- it should be sufficient protection againt any attack.

    If you are using some other system or some other db, let us know.

  • #3
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    Quote Originally Posted by listerdl View Post
    Is there something you would strongly advise me to do?
    I think you'll find prepared statements is the best defence against sql injection and other types of attack.
    Last edited by bullant; 06-18-2011 at 06:12 AM.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,111
    Thanks
    75
    Thanked 4,333 Times in 4,299 Posts
    Point conceded. Prepared statements have other advantages as well.

  • #5
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    I was just replying to the op's question.

    I didn't realise I was in a tennis match as well

    15 - love


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •