Jump to content

Recommended Posts

Slightly different slant on it - any string data that could contain special characters that would break a query (or allow sql injection) that is placed into a query statement should use mysql_real_escape_string(). This includes all string data from an external source and any internal string data that could contain special character (assuming that magic_quotes_runtime is OFF) or internal string data that you don't explicitly know does not contain any characters that could break a query.

 

Safe usage would be to use it on any string data placed in a query.

You can enter data straight into your database but you should only do it for testing purposes without mysql_real_escape_string() your leaving a door wide open to hackers and the like.

 

Also have you heard of htmlentities() function It helps with user input aswell!!

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.