I have the following data stored in a field "call_dtls" in a mysql table. This data is stored as TEXT
datatype. Data is submitted using a <textarea>
control from a PHP-generated page.
Code for storing data in mysql:
$mycalltext = mysql_real_escape_string($_POST['text']);
// then storing $mycalltext in the table
The Data which gets stored in the table (each line is stored in a separate table row):
SANDY505™ (09-11-11 10:04:47): buy hinduniliver around 385-383 sl 380 trgt 390-393 SANDY505™ (09-11-11 10:05:57): buy tatasteel around 472-468 sl 464 trgt 476-480 SANDY505™ (09-11-11 10:06:09): buy nifty around 5295-5280 sl 5260 trgt 5320
When another page later fetches and displays the data, the ™ gets replaced by � and everything is displayed as a single line (the line breaks are ignored). Example:
SANDY505� (09-11-11 10:04:47): buy hinduniliver around 385-383 sl 380 trgt 390-393 SANDY505� (09-11-11 10:05:57): buy tatasteel around 472-468 sl 464 trgt 476-480 SANDY505� (09-11-11 10:06:09): buy nifty around 5295-5280 sl 5260 trgt 5320
I want the output to be (line breaks included):
SANDY505™ (09-11-11 10:04:47): buy hinduniliver around 385-383 sl 380 trgt 390-393 SANDY505™ (09-11-11 10:05:57): buy tatasteel around 472-468 sl 464 trgt 476-480 SANDY505™ (09-11-11 10:06:09): buy nifty around 5295-5280 sl 5260 trgt 5320
Code that produces output:
$rs=mysql_query("Select * from mya_calls", $cn) or die("MySQL error: ".mysql_errno());
$number=mysql_num_rows($rs);
while ($rsitem=mysql_fetch_object($rs))
echo $rsitem->call_dtls;