Jump to content
Sign in to follow this  
lugos

PHP / MySQL Parameter Substitution

Recommended Posts

Hello,I'm fairly new to PHP. Is parameter substitution possible/necessary using PHP and MySQL to prevent SQL injection attacks? Are there any other methods that can be used to protect oneself from those types of attacks?Thanks.

Share this post


Link to post
Share on other sites

Yes, they are possible by the use of PDO statements or MySQLi statements. But it's not required. You can instead use a string escaping function, and concatenate its output (the "safe from SQL injection" string) to the query. For MySQLi, that would be mysqli::real_escape_string().

Share this post


Link to post
Share on other sites

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.

Loading...
Sign in to follow this  

×
×
  • Create New...