I am trying to store formatted text (windows format) into a MySQL
database and then retrieve it. The field in the database is a
varchar. I cut and paste the test into a form field formatted, then
call the PHP program to add the record using POST. When I get the
text out, it has lost it's formatting. Formatting in the text is
achieved by multiple spaces not tabs, but even multiple spaces are
converted to a single space and the carrage return/line feeds are
lost. Below is the basic code I am calling when I click POST in the
form.
I would really appreciate advice on how I can make this work. I have
looked through many sites, and have not seen anything with deals with
this sort of problem.
Thanks in advance.
James.
-----------------
Code Below.
-----------------
<?PHP
$date=$_POST['date'];
$title=$_POST['title'];
$scores=$_POST['scores'];
$db=mysql_connect("localhost","root") or die ("cannot connect");
mysql_select_db("mydb") or die ("can not select database");
$query="INSERT INTO scores (scoresdate, scorestitle, scorestext)
VALUES ('$date', '$title', '$scores')";
printf($query);
$result=mysql_query($query) or die ("Invalid Query : " .
mysql_error());
echo "Thank you!";
?>