characters problem

From: Date: Fri, 17 Dec 2004 07:38:15 +0000
Subject: characters problem
Groups: php.db 
Request: Send a blank email to php-db+get-37732@lists.php.net to get a copy of this message
Dear All, I am using php and mysql the last two years, and I still cannot find the way to update a field on mysql from php that containts the single quotes ( ` and ' ) Examples Here is an example of my index.php file. I have to type something on "Comments" field ----------------------------------------------------------------------------- <? include("../configs/dates.inc"); include("../configs/config.inc"); echo " <br> <body bgcolor=#FFF8E1 text=#2003CF link=#2003CF vlink=#2003CF alink=#2003CF> <center> <form method=post action=add.php> <font face=\"Comic Sans MS\">Comments<br><textarea rows=3 cols=40 name=mycomments tabind ex=22></textarea> <input type=submit name=Submit value=\"Add Ticket\"> <input type=reset name=Reset value=\"Clear Form\"> "; mysql_close($myconn); ?> ----------------------------------------------------------------------------- In the html text area, I am typing the following text : Hello My name is Panos and I'm from Greece The add.php file looks like this : ----------------------------------------------------------------------------- <? include("../configs/dates.inc"); include("../configs/config.inc"); $myquery="INSERT INTO $table (comments) VALUES ('$mycomments')"; $myresult=mysql_db_query($db,$myquery); mysql_close($myconn); echo "done"; ?> ----------------------------------------------------------------------------- ANd when i'm trying to see what was added on mysql, i have the following result : Hello My name is Panos and I\ ----------------------------------------------------------------------------- The field on mysql is TEXT Does anyone knows how can i resolve this problem? Thanks Panos

« previous php.db (#37732) next »