?
Solved

MySql special characters

Posted on 2014-12-01
2
Medium Priority
?
248 Views
Last Modified: 2014-12-01
Hi E's, I have a simple question about php and MySql:
When I send to the database words like "hello" "cars" etc, the database save that words, but when I use something like "don't" and other words with " ' " the database don't save.
What is the php function for resolve this problem?

The best regards, JC
0
Comment
Question by:Pedro Chagas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
tel2 earned 1680 total points
ID: 40474914
Hi Pedro,

It would be helpful if you paste some code so we can see exactly, but I think this may be what you need:
    mysql_real_escape_string
http://php.net/manual/en/function.mysql-real-escape-string.php
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 320 total points
ID: 40474916
Depends on the library you are using and how you are inserting - you can escape the apostrophe in a string that is using apostrophes with the backslash e.g.

'some text with don\'t'

Open in new window

0

Featured Post

WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question