Hi,
I have a column in my db that stores data like so 'bla,bla' now I would like this to echo out as '<ul><li>bla</li><li>bla</li></ul>'.
I have the following code, but this stores it on the one <li></li> rather than starting a new, when it reaches a comma.
echo '<ul>';
$r = mysql_query("SELECT interest FROM listings WHERE hc = '$hc' ORDER BY interest ASC");
if (mysql_num_rows($r) > 0) {
while ($menu_row = mysql_fetch_array($r, MYSQL_NUM)) {
echo '<li>' . $menu_row[0]. '</li>';
}
}
echo '</ul></p>';
That code doesn't consider the comma, which I would need it do, to add another line to the list.
So I need it to end up like <li>test1</li><li>test2</li> etc.
Right now it's just <li>test1,test2</li>
Any help would be fan-brilliant-astic!