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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:57:33+00:00 2026-06-17T19:57:33+00:00

I was making a search for project i was working on. when someone search

  • 0

I was making a search for project i was working on. when someone search for a term it will be save in a MySQL database. im using mysql_real_escape_string to escape special characters but still special characters are saving in the database for a example

Don’t become Don\’t

then i tried htmlspecialchars it is still the same. i even change the db to utf8_general_ci also i tried all togather.

here is the code

$addSearch = htmlspecialchars($search);
$addSearch1 = mysql_real_escape_string($addSearch);
mysql_query("INSERT INTO search (term) VALUES('$addSearch1') ") 
or die(mysql_error());  

can anyone tell me a solution for this. thanks in advance.

  • 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-17T19:57:35+00:00Added an answer on June 17, 2026 at 7:57 pm

    Try like this….

    $height='aA1`';
    $value=preg_replace("/[^\`a-z,. \'\-\d]/i", "", $height);
    $value=mysql_real_escape_string($value);
    mysql_query("INSERT INTO `table` SET `column`='$value'") or die(mysql_error());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a Windows Form project that will search for files in the specified
I am using SQL Server 2000 and ASP.Net with c# for making a search
I'm making a project where I want the user to search for shops in
I relatively new to Umbraco but using a somewhat contrived pet project I'm making
I am editing a search form and trying to protect against special characters in
I'm making a project for my studies. During construction of the search engine for
I am making a research project on search engines, and i am having problems
I am making a search query on local Apache Solr Server by browser and
I'm making a simple search form in rails. In my search view I have
Ok, I attempted at making my own search function which doesnt work very well.

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.