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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:33:24+00:00 2026-06-07T18:33:24+00:00

When I use mysqli->real_escape_string and add a string value to the db such as

  • 0

When I use mysqli->real_escape_string and add a string value to the db such as “who’s”, it adds the string without modifying the quote in any way. When I check the db, the value within it is “who’s”.

When I do not use mysqli->real_escape_string and add a string with a single quote like “who’s”, it just doesn’t get added to the database. It is nowhere to be found.

This isn’t normal, is it?

  • 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-07T18:33:27+00:00Added an answer on June 7, 2026 at 6:33 pm

    Yes, it is. It’s a little difficult to answer this question in any more detailed a way than that.

    real_escape_string() only escapes the data so it can be safely used in a query, it doesn’t modify it in any way. When you don’t escape it, the query has a syntax error in it so it fails – and the data is not inserted.

    However the safest way to escape your data is to use prepared statements.

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

Sidebar

Related Questions

I use MySQL 5.5.16. I'm trying to check if a certain column exists in
I've started to use mysql_data_seek () as an easy way to roll pagination transparently
When i add something to my mysql db, i use mysql_real_escape_string(), then put it
I'm trying to harden some of my PHP code and use mysqli prepared statements
I am trying to use mysqli for the first time because i have some
I have a query string being built and it works fine when I use
Possible Duplicates: Htmlentities vs addslashes vs mysqli_real_escape_string When to use which string escaping method?
So, I started to use MySQLi extension as I heard it will be the
to sanitize user input we usually use mysql_real_escape_string, but for example if i want
To prevent SQL injection, is it necessary to use mysql_real_escape_string() , when magic_quotes_gpc is

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.