View Full Version : How to insert <text> into a text field
I need to insert the following text into mysql db: <text1>.<text2>. When I run a statement insert into table(field1) values ('<text1>.<text2>') the output is .. .. If I run a statement insert into table(field1) values ('<<text1>>.<<text2>>') the output is <><>. The statement insert into table(field1) values ('\<text1\>.\<text2\>') produced .. .. result.
Please help!!!!!!
motormichael12
09-16-2008, 04:31 PM
insert into table(field1) values ('<,text1>.<text2>')
To convert text in PHP do it like this:
$var1 = "hey <b>there</b> <span>ted</span>";
$var1 = htmlentities($var1);
echo $var1;
That returns:
hey <b>there</b> <span>ted</span>
However when that is placed in HTML it is parsed, so the display on a web page would be EXACTLY as is is set in $var1, with the errors. It will not parse the HTML unless you decode it.
Thanks a lot, it works beautifully.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.