I want to display many photos which belong to same alias, for example if i have many phographs of Apple and and want to show them all at once having one photo as main and others as a thumbnails of all apples.
$url=$_GET['photoUrl'];
$sql = "SELECT * FROM photos WHERE photoUrl='$url'";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
    $photoId=$row['photoId'];$photoName=$row['photoName'];$photoDesc=$row['photoDesc'];$photoUrl=$row['photoUrl'];$photoCategory=$row['photoCategory'];}
Above code is the main file called photo.php (which works perfectly for fetching all photos) and below code is morephoto.php which i include in photo.php.
why i am writing this below code because if i have signle apple photo as main photo and just beneath or above a photo bar like carausal will appear having many apple photos
so thing is may be i am just failing to co-relate photo.php with morephoto.php
<?php
include('admin/config.php');
$aliasPhoto=$_GET['alias'];
$sql = "SELECT * FROM photos WHERE alias='$aliasPhoto' LIMIT 0, 8";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
    $photoId=$row['photoId'];
    $photoName=$row['photoName'];
    $photoDesc=$row['photoDesc'];
    $photoUrl=$row['photoUrl'];
    $photoCategory=$row['photoCategory'];       
?>
                <div class="col-md-3">      
                    <a href="<?php echo"$photoUrl.html";?>">
                        <img class="img-responsive thumbnail" src="images/<?php echo"$photoUrl.jpg";?>" <?php echo "alt=\"$photoName\" title=\"$photoName\"";?>>
                    </a>                
                </div>
 
     
    