In my database I have records like:
Primer parrafo.<div><br></div><div>Segundo parrafo.</div>
How to represent in my interface those paragraphs with the HTML that I have in my database? Right now I do:
$last_product = $pdo->prepare("
SELECT * FROM products WHERE 1
ORDER BY product_insert_date DESC
LIMIT 1");
$last_question->execute();
$result = $last_question->fetchAll(PDO::FETCH_OBJ);
foreach ($result as $row){
echo $new_body = $row -> product_description;
}
It returns this as is: Primer parrafo.<div><br></div><div>Segundo parrafo.</div>
and the expected result is:
Primer parrafo.
Segundo parrafo.
1 Answers