Following is the PHP code I'm facing problem with:
<?php
$query="SELECT `url` FROM `videos";
$query_run=mysql_query($query);
while($row=mysql_fetch_array($query_run)){
$result[]=$row;}
foreach($result as $var){
$url=$var['0'];
echo "<iframe width='250' height='200' src='".$url."' frameborder='0'>";
}
?>
The problem is that it returns only one result of <iframe>
tag, but echoing out $url
i.e
<?php
$query="SELECT `url` FROM `videos`";
$query_run=mysql_query($query);
while($row=mysql_fetch_array($query_run)){
$result[]=$row;}
foreach($result as $var){
$url=$var['0'];
echo $url;
}
?>
returns all the available results.
Please help