jc_gmk
11-01-2007, 03:01 PM
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:
$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>";
}
If one of the values returned is "something & something" it won't change it to "somthing & something"
-----------------
I want to use the result of "$info['somedata']" in a url
e.g.
http://somthing.com?somthing=something%20&%20something
and not
http://somthing.com?something=something & something
only if I use $GET['something'];
it only gets the value "something" not "something & something".
Hope this makes sense!
Here's an example of the 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>";
}
If one of the values returned is "something & something" it won't change it to "somthing & something"
-----------------
I want to use the result of "$info['somedata']" in a url
e.g.
http://somthing.com?somthing=something%20&%20something
and not
http://somthing.com?something=something & something
only if I use $GET['something'];
it only gets the value "something" not "something & something".
Hope this makes sense!