I am storing HTML code in my MySQL table column. For inserting records, I framed the query like this:
$InsertQuery = "INSERT INTO listing (ldate, places, company, designation, projectdetails, desiredcandidate, hrname, hrcontact, email) VALUES (DATE_FORMAT('" .$ldate ."','%Y/%m/%d'),'" .$places. "','" .$company. "','" .$designation. "','" .htmlentities($projectdetails). "','" .htmlentities($desiredcandidate). "','" .$hrname. "','" .$hrcontact. "','" .$email. "')";
But when I am output the results using following code, it shows the text with HTML tags. It is not implementing the tags on the page.
$FetchResultsQuery = "SELECT * FROM listing WHERE recordid=" . $SelectedRowID;
$result = mysql_query($FetchResultsQuery);
$row = mysql_fetch_row($result);
if ($row)
{
$PostedDate = date($row[0],'d.m.Y');
$Places = $row[1];
$Company = $row[2];
$Designation = $row[3];
$ProjectDetails = $row[4];
$DesiredCandidate = $row[5];
$HRName = $row[6];
$HRContact = $row[7];
$Email = $row[8];
}
<td valign="top" style="padding-left:10px; text-align:justify;"><h4> </h4>
<p><strong>Company Name: </strong> <strong><?PHP echo $Company; ?></strong></p>
<p> </p>
<p><strong>Location: </strong> <?PHP echo $Places; ?> </p>
<p> </p>
<p><strong>Posted Date: </strong><span class="style19"> <?PHP echo $PostedDate; ?></span></p>
<p> </p>
<p><strong>Designation:</strong><?PHP echo $Designation; ?></p>
<p> </p>
<p><strong>Project Details :</strong></p><br>
<?PHP echo $ProjectDetails; ?>
<p> </p>
<p><strong>HR Name: </strong> <?PHP echo $HRName; ?> </p>
<p> </p>
<p><strong> HR's Contact details: </strong><?PHP echo $HRContact; ?></p>
<p> </p>
<p><strong>Email: </strong><?PHP echo $Email; ?></p>
<p><span class="style18"><strong><br />
<br />
</strong></span></p></td>
<td></td>