Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
grahamgr3

Difference Between Mysqli_Real_Escape_String And Escape_Data()

Recommended Posts

What is the difference between mysqli_real_escape_string and escape_data(). 

When should we use escape_data() as opposed to mysqli_real_escape_string.

Share this post


Link to post
Share on other sites

If you look at the code, you'll see that escape_data() wraps mysqli_real_escape_string() and that it also: 1) removes slashes if Magic Quotes is enabled, and, 2) trims strings (I think). You would use escape_data() if you wanted that functionality all the time, or use a modified version if there's other functionality you want on all values used in queries. 

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.
Note: Your post will require moderator approval before it will be visible.

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