Only one record is showing

I have got this working part way it displays as i need but there is 3 other profiles in the database that are not echoing out at all. it just shows 1 profile


CREATE TABLE `Games` (
  `GameID` int(10) UNSIGNED NOT NULL,
  `GameName` varchar(255) NOT NULL,
  `GameCover` varchar(300) NOT NULL,  
) ENGINE=MyISAM DEFAULT CHARSET=utf8;    


CREATE TABLE `mods` (
  `ModID` bigint(11) UNSIGNED NOT NULL,
  `GameID` int(11) DEFAULT NULL,
  `ModName` text NOT NULL,
  `ModCover` varchar(300) NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;



<?php 


$stmt = $db->prepare("
SELECT U.ID,
       U.FullName,
       U.Email,
       U.JobTitle,
       U.Bio,
       U.Photo,
       group_concat(G.GalleryImage) as GalleryImage 
FROM users as U 
join gallery as G 
ON U.ID = G.ID 
group by U.ID

 ");


$stmt->execute();
$result = $stmt->get_result();


 while ($row = mysqli_fetch_assoc($result)) {
        
        $ID = $row['ID'];        
        $FullName = $row['FullName'];    
        $Email = $row['Email'];   
        $JobTitle = $row['JobTitle'];
        $Bio = $row['Bio'];
        $Photo = $row['Photo'];               
          
               
        
   echo "<div class='container team-wrap'>
           <div class='row'>
             <div class='col-md-6'>
             <img class='img-responsive' src='$ProfileImage'>
               </div>
                 <div class=\"col-md-6\">
                    <strong>$FullName<br>$JobTitle</strong>
                      <br>
                      <p>$Bio</p>
                      <a href='mailto:$Email' class='btn btn-info'>Contact Me</a>
                </div>
             </div>
          </div>";
   
     
   
   $GalleryImage = explode(',', $row['GalleryImage']);
   
   foreach ($GalleryImage as $img){ 
   
       echo "<img style='height: 100px; width: 100px;' src='cdn/assets/gallery/$img'>";
   
   }
   
   
}  
?>

show the database or provide an example on sqlfiddle.com that replicable shows your problem on an defined set of data. (do they have different U.IDs?)

1 Like

Try the query direct against the database, how many records get returned?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.