如何在sql php中的文本中检索html代码作为预览

I submitted some text to an SQL database like this:

"You can check my photo below (img src=..myimg.jpg..)and please also comment."

Now i want to retrieve it in PHP and containing image preview. The image code is HTML.

You need to escape data from DB before presenting it in page in order to what is stored doesn't mess with your page. But if you want also show the image, then you have to extract the img src part and put it back inside escaped output in proper html tag.