how, inserting quotes into DB, how?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gphp
Forum Commoner
Posts: 29
Joined: Sun Feb 17, 2008 1:40 pm

how, inserting quotes into DB, how?

Post by gphp »

I would like to insert text that contains quotes and other special characters into DB(MySql). Is there a way to take the text and make an insert without bailing out because of these special characters?
Or, what is the best way to pass the single quotes into the database?
Thanks.
p3rk5
Forum Commoner
Posts: 34
Joined: Thu Jan 29, 2009 10:19 pm

Re: how, inserting quotes into DB, how?

Post by p3rk5 »

User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: how, inserting quotes into DB, how?

Post by VladSun »

mysql_real_escape_string() is better
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply