I'm trying to build a select list from an array and the database has HTML in the field that I'm using but when I use strip_tags it pulls nothing from the database. If I remove the strip_tags everything works fine. Do you have any suggestions, here is the code:
$result1 = mysql_query("select * from events where season = 2003 order by event_title asc");
$result1 = strip_tags($result1);
while($row = mysql_fetch_array($result1))
{
echo ("<option label='" . $row["event_title"] . "'" . "value='eventName1'>" . "</option>");
}
It appears that you are only taking one variable from $result1.
I dont believe that you can strip tags from a whole array.
So just strip tags for each array element like so:
PHP Code:
$result1 = mysql_query("select * from events where season = 2003 order by event_title asc");
while($row = mysql_fetch_array($result1))
{
echo ("<option label='" . strip_tags($row["event_title"]) . "'" . "value='eventName1'>" . "</option>");
}
I havent tested it but it should work.
__________________ ArecaWeb Team
Gregg Kenneth Jewell