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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:17:48+00:00 2026-06-17T07:17:48+00:00

I am learning PDO after the many people telling me to do so. However

  • 0

I am learning PDO after the many people telling me to do so. However in updating one of my scripts, PDO is causing me a problem that I’m not sure how to fix.

My problem is a user will input the title to the website. Say its “Smith’s Inventory”.

Since the whole PDO switch, it is saved in the db as “Smith\’s Inventory”. Which is output in various places on my website. Such as the header, the html title, and the settings text box. If you click save again with \’, then you get \\’, and so on.

I realize why this is done, but how can it be fixed?

Here is the instert code:

foreach ($_POST as $key => $value)
{
    $sql = $dbh->prepare("UPDATE settings set value=? where variable=?");
    $sql->bindParam(1, $value);
    $sql->bindParam(2, $key);
    $sql->execute();
}
echo '<h2><font  color=green>Saved</font></h2>';
  • 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-17T07:17:49+00:00Added an answer on June 17, 2026 at 7:17 am

    You can use stripslashes on the PHP side.

    <?php
    $str = "Is your name O\'reilly?";
    
    // Outputs: Is your name O'reilly?
    echo stripslashes($str);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning PDO, and finding it tricky to make sure my statements work correctly.
I've just started learning aboud PDO and prepared statements (which sure seem to beat
So, I've been learning PDO. So far, I am not at all impressed, honestly,
I have a problem with my PDO class. I just have started learning OOP
So I'm working on learning PDO, and making the transfer from the standard PHP
I'm on my way learning about PDO from phpro.org, and a little bit confuse.
Learning a lot in my few years of programming that the best projects are
I am learning OOPS concept and also using PDO , but really stuck in
how would i get a random rowcount using PDO? i'm still learning how to
learning Jquery and integrating with PHP - getting there, but have one last challenge

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.