Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 696571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:04:37+00:00 2026-05-14T03:04:37+00:00

I was looking through the docs and stumbled onto mysql_real_escape_string() and I’m not understanding

  • 0

I was looking through the docs and stumbled onto mysql_real_escape_string() and I’m not understanding why it’s useful when you can just addslashes(). Can someone show me a scenario as to why it’s useful?

I’m also curious why it requires a database connection…. that seems like a lot of overhead.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:04:38+00:00Added an answer on May 14, 2026 at 3:04 am

    There is a great article about this here. And this discussion also points out the pros and cons of each solution.

    addslashes() was from the developers
    of PHP whereas
    mysql_real_escape_string uses the
    underlying MySQL C++ API (i.e. from
    the developers of MySQL).
    mysql_real_escape_string escapes EOF
    chars, quotes, backslashes, carriage
    returns, nulls, and line feeds. There
    is also the charset aspect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been looking through the reference docs and can't find any mention of a
I was just looking through some information about Google's protocol buffers data interchange format.
I was just looking through the man page for printf and something occurred to
I have been going through the docs and source code looking for something without
After looking through the docs on App Engine and the StringListProperty or the ListProperty
I'm looking through the docs for the jQuery UI Datepicker ( http://jqueryui.com/demos/datepicker/ ), but
Looking through the Django docs and trying to figure out the use of the
Looking through PIL (and related to this question ), where can I get a
Today while researching for a project I was looking through the docs for Dictionary<TKey,
Heroku recently began supporting Java apps. Looking through the docs, it seems to resemble

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.