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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:40:39+00:00 2026-05-20T09:40:39+00:00

I am redesigning a new website and my database table need tidying up a

  • 0

I am redesigning a new website and my database table need tidying up a bit.

In the mysql table, I have a data look like this for example:

text text text text - he\'s text text text he\'s text text
text couldn\'t text text.<br /><br />\"I\'m text text
text text. We\'re text <br /><br />text text

I need to remove all the slashes () and remove all the
. What the best way doing this?

From now on I will use mysql_real_escape_string() when adding data. To view use

nl2br()
  • 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-20T09:40:40+00:00Added an answer on May 20, 2026 at 9:40 am

    Ensure that magic_quotes_gpc is off, it’s good practice. You can always use parse your database and reinsert it all.

    str_replace is right but don’t use it if the data has been escaped, use stripslashes on the data.

    <?php
        $row = array(
            1 => 'stripslashes removes any unwanted \\\\',
            2 => 'it\'s easy but annoying but we must do it!'
        );
        foreach ($row as $key=>$record) {
            $escaped[$key] = stripslashes($record);
        }
        echo $escaped[1].'<br />';
        echo $escaped[2];
    ?>
    

    Outputs:

    stripslashes removes any unwanted \

    it’s easy but annoying but we must do it!

    Then re-insert it.

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

Sidebar

Related Questions

I'm currently redesigning a website and have run into an issue with some elements
We are redesigning table schema in postgres. It used to have a linker table
I've been tasked with redesigning part of a ms-sql database structure which currently involves
I am reviewing / redesigning / refactoring a database and want to create a
Our team is currently working on completely redesigning our school's website and one of
I have a problem with a site I am redesigning and the problem is
I need to get the table name to query from a table. var tableName
A two parter: 1) Say you're designing a new type of application and you're
I am redesigning a command line application and am looking for a way to
My company is redesigning our intranet site and decided to go with DotNetNuke as

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.