cannot seem to retrieve html from db

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 1
Joined: Tue Oct 17, 2017 6:54 am

Tue Oct 17, 2017 7:08 am

Hi All

I hope my question isn't too silly... but I am having trouble retrieving html from a database.
When I look in the db table I can see the data in there something like:

Code: Select all

<p>This pupils can <em>speak</em> really well and ...... </p>

I am using tinymce to create some descriptions in a php/mysql db and using php to retrieve the info.

Now I am using a function in a library called phpdocx.

If I do this:

Code: Select all

$titlewf->embedHTML('<p>This pupils can <em>speak</em> really well and ...... </p>')
everything is fine. So I know that if I put properly formatted html into the function all is well.

I have created a query to retrieve the html from the db like this. The html is returned as $desrow['d']

Code: Select all

$desc = $conn->query($query3);
	while ($desrow = $desc->fetch_assoc()){
My problem comes when I put $bob into the function like this:

Code: Select all

As far as I can see $bob is identical to the '<p>This pupil....' as described above and so it should work

So something is wrong. I have tried

Code: Select all

but that didn't work.

Any tips very gratefully received.


php-forum Fan User
php-forum Fan User
Posts: 564
Joined: Fri Apr 01, 2016 2:18 am

Tue Oct 17, 2017 10:14 pm

you have to look what the embedHTML() function does with the two strings.

Post Reply