Let suppose we've database table my_code
Input
I'll create connection to this database table I'll create form with post action I'll create inside this form a textarea where i would write the input

I want
To add HTML code inside this textarea to be saved in database table my_code
then i can get the HTML code applied in output page.
Output Problem
If i put the following code inside the textarea after i replaced < to < and > to >

Now the output when i can it from database table my_code will appears as code

While i want it appears normally as visual HTML (applied) as following

Note : someone said rather than rendering html code in the input text just put it as it < and > and yes it would appears in output just as i want but when i try to edit it in edit page will find a huge distortion where it become active as textarea inside textarea so i must rendering it but in same time i want it appears as i want.
This problems hurts me so much so any idea,keywords or solutions for it please give help, thanks.