Hi this is my piece of code , I don't understand why the code within my foreach is not reachable ,
$content = "";
/*** the upload directory ***/
$upload_dir= '/gallery/school/'.$name.'/';
$images = glob($upload_dir."*.*");
foreach($images as $image) {
$content .= ' <li>
<img src="'.$image.'" alt="">
<p class="caption">This is a caption</p>
</li>';
}
Here is the Entire code , the code before the foreach works perfectly fine . But the code inside is unreachable when i try to echo the $content , It gives blank output i.e $content does not contain anything
<?php
include "storescrpt/connect_to_sql.php";
if(isset($_GET['dc_id']))
{
$day_care = $_GET['dc_id'];
$sql = mysql_query("select * from school where id='$day_care'");
$count =mysql_num_rows($sql);
if($count>0)
{
while($row= mysql_fetch_array($sql))
{
$name = $row['name'];
$phone = $row['phone'];
$address = $row['address'];
$desc = $row['desc'];
$Fac = $row['Fac'];
$area = $row['area'];
$gog = $row['gog'];
}
}
$content = "";
/*** the upload directory ***/
$upload_dir= '/gallery/school/'.$name.'/';
$images = glob($upload_dir."*.*");
foreach($images as $image) {
echo $image;
$content .= ' <li>
<img src="'.$image.'" alt="">
<p class="caption">This is a caption</p>
</li>';
}
}
?>