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

  • Home
  • SEARCH
  • 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 9137343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:05:31+00:00 2026-06-17T09:05:31+00:00

I always got \ (back slash) from any variables which I put mysql_real_escape_string into.

  • 0

I always got \ (back slash) from any variables which I put mysql_real_escape_string into. for example :

$string = mysql_real_escape_string($_GET['string']);
echo $string; //result : here\'s the text

and after I did some research on Google, some people says that this back-slash caused by server setting which has magic_quotes_gpc turned on. which I have this configuration too. I see it on my phpinfo(), magic_quotes_gpc = ON

my question is… Is it really safe to turn off this magic_quotes_gpc?
Because I’m using mysql_real_escape_string to prevent mysql injection. by turning magic_quotes_gpc off, I’m afraid this will cause my server ‘less powerful’.

  • 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-06-17T09:05:32+00:00Added an answer on June 17, 2026 at 9:05 am

    It sounds to me like you need to have some fairly basic tuition on these subjects. You’ve clearly been reading up on the internet and following examples, but without actually understanding why the examples are doing what they’re doing, or how they work. Copying examples without understanding them is not a good thing.

    So at the core you need some deeper understanding of the topics, which is probably too much for a site like this to provide (SO is more about helping people solve specific problems than teaching them whole subjects, though you will learn a lot from browsing the site).

    However, I will address some of your points:

    • Magic Quotes is an obsolete PHP feature; in fact, it’s been removed entirely from the most recent versions of PHP. Disabling it will not make your server “less powerful”, or anything of the sort. In fact, it is recommended not to use it.

    • All the functions beginning with mysql_ have also been deprecated and are not recommended any more. The newer alternatives are the mysqli_xxx() functions or the PDO library. If you’re following tutorials using the old functions, you should find a newer tutorial.

    • The mysql_real_escape_string() function (and the mysqli/PDO equivalents) is intended to add a slash to your string where it finds quote characters or other characters that would cause a SQL statement to be invalid. Finding a slash in your string after running this function is perfectly normal and correct. This is called “escaping” the string (hence the name of the function). The “escaped” version of the string should only be used in the context of building a SQL query.

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

Sidebar

Related Questions

I got into a discussion a while back. The company I work at develop
I'm trying to upload a jpeg image buffer I got back from the Camera.
I just got an assignment back, which was marked down due to the following
When I started Xcode I always got a screen that let me choose which
Simple question that i've always pondered about. When I first got into opengl I
I have a spurious problem which seems to indicate the index value got from
I always got this error guys on my site.Anybody got a solution. Stacktrace at
I am trying to use a dataContext to populate a comboxbox but always got
I got one main search field always visible at the site and a login
Observed: First, 'ctrl+v'+selection always worked before for me. But this time, i got normal

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.