rams73
asked on
simple/complicated
Hi
I have a html form
input type = text name=comment
in the comment the user keys in as
I use old car's
The variable comment ="I use old car's";
I make a post of this html form and in the next link i store this in my data base (oracle);
while doing this i am getting an error" open quotes not ended properly", How to avoid this.
i know because of this (car's) quotes the error is comming, i want the quotes also to be stored in the database, how to do this...
thanks
rams
I have a html form
input type = text name=comment
in the comment the user keys in as
I use old car's
The variable comment ="I use old car's";
I make a post of this html form and in the next link i store this in my data base (oracle);
while doing this i am getting an error" open quotes not ended properly", How to avoid this.
i know because of this (car's) quotes the error is comming, i want the quotes also to be stored in the database, how to do this...
thanks
rams
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
LOL - beat me too it!
:o)
Ant
:o)
Ant
ASKER
The above things didn't worked for me since i am using oracle database but i could find the correct ans from the url
http://www.php.net/manual/en/function.addslashes.php
You have to search for single quotes and replace with double quotes, that is it.
http://www.php.net/manual/en/function.addslashes.php
You have to search for single quotes and replace with double quotes, that is it.
lesson learned: I should provide some URLs on every answer I give :-)
Marian
Marian
Glad to have helped.
:o)
Ant
:o)
Ant
The string must be escaped by slashes "I use old car\'s", to do that you can use addslashes() in PHP and stripslashes() to remove them later.
So use addslashes($comment) within your SQL statement. If you get the string back from a select statement you should do $commant = stripslashes($sql_result_f
hope that helps
Marian