I am pulling information from a MySQL database and trying to change characters into html characters only it's not working, any ideas?
Here's an example of the code:
If one of the values returned is "something & something" it won't change it to "somthing & something"PHP Code:$query = "SELECT * FROM mytable WHERE something='something'";
$result = mysql_query($query) or die(mysql_error());
while ($info = mysql_fetch_array($result))
{
print htmlentities($info['somedata']) . "<br>";
}
-----------------
I want to use the result of "$info['somedata']" in a url
e.g.
and notHTML Code:http://somthing.com?somthing=something%20&%20something
only if I useHTML Code:http://somthing.com?something=something & something$GET['something'];
it only gets the value "something" not "something & something".
Hope this makes sense!



Reply With Quote

Bookmarks