Problems Inserting Single Quote Into Database

RegisterLogin
Problems Inserting Single Quote Into Database
Post Description: Problems Inserting Single Quote Into Database
Tags: Problems, Inserting, Single, Quote, Into, Database
This Post Was Posted On Sep 27, 2009 By Justin #2426
for some reason, everytime i try to enter a string that contains this character:

'

it doesn't works

for example i have this:

$string = "This isn't working";

the database gives me an error, but when i remove the isn't part like this:

$string = "This is working";

what is the problem? do i need to get another dedicated server because the server you gave me is broken?

please advise.
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
webune
#2426 1
hi justing, all you have to do is escape your strings properly in php change your string like this for example:

$string = "This isn't working";
$string = mysql_real_escape_string($string);

OR

$string = mysql_real_escape_string("This isn't working");

it should work like if you use mysql_real_escape_string() function

Webune Support Team
Sep 27, 2009 Reply Report abuse
©2012 Webune Forums - Sat Dec 15, 2012 10:45 am
Powered by: Webune Forums V3