Hi
I am trying to separate each url with a <br> feed from the database. As some of the url are a string of urls like:
http://www.domain.com/image1.gif;htt...com/image2.gif
whereas some are just a single url. So, how am I to split them into a single url per line?
Any advice is appreciate.
Code:
<?
$username="dbuser";
$password="dbpassword";
$database="database";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM post_photo";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Database Output</center></b><br /><br />";
$imgcode=split(";",$row[extcode] );
$i=0;
while ($i < $num) {
$imgcode=mysql_result($result,$i,"extcode");
echo "<b>$imgcode
</b><br />";
$i++;
}
?>