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 8407577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:24:16+00:00 2026-06-09T23:24:16+00:00

My problem seem’s trivial but I havn’t found any good solution to this. First

  • 0

My problem seem’s trivial but I havn’t found any “good” solution to this.

First a question that I’ve heard many answers on, when to we need to parse a string with mysql_real_escape_string()? My thought is that it’s only needed when to store user given data in a database, is that a good rule to follow?

My second question and that’s the real problem. When I parse a string with mysql_real_escape_string(), it will put a special character \ before any harmful character in the string, ex. if the function finds a ' then it will be appended with a \ so the result is \'.

Well ok, that’s fine, the problem is when I read the same string from the database, then I also get the \ character. Is there any good way to get rid of \ character?
One thought I’ve had is to use the str_replace("\\","",$string), but is this a good and safe way to do this?

Thank you all!

  • 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-09T23:24:18+00:00Added an answer on June 9, 2026 at 11:24 pm

    First, the use of mysql_real_escape_string is discouraged. Check if magic_quotes are on:

    echo "Magic quotes is " . (get_magic_quotes_gpc() ? "ON" : "OFF");
    

    Or you can use stripslashes

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

Sidebar

Related Questions

This problem may seem like school work, but it isn't. At best it is
hey guys having this really simple problem but cant seem to figure out have
I am new to PHP so please forgive if this question or problem seem
Strange Question i guess but i have this bit of code in my page...
This problem doesn't seem browser specific and generally applies to style in the webkit/gecko/mozilla
Here's a problem that I seem to be running into working with an accounting
this is my first time asking a question here so apologies if I am
This problem seem to happen only in chrome This is the iframe code <!DOCTYPE
This seems like it should be an easy fix, but so far a solution
No foreign keys defined in the database. So I've setup associations. problem: can't seem

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.