How to add images from a database together if they have the same foreign key

Cooldude

New Member
So my problem is i am exporting images from a table called "BikeImages" within this table theres images that our under the same foreign Key BikeCode. How do i make sure the images are added together instead of seperately.For ExampleBikeCode: 123BikeImages: IMAGE1, IMAGE2BikeCode: 14BikeImages IMAGE1\[code\] <?php $sql = "SELECT SourcePath, Description, BikeCode FROM BikeImages"; $result = mysqli_query($con, $sql);while(list($sourcepath, $description, $bikecode) = mysqli_fetch_row($result)) { echo " <table> <tr><th>Bike Images:</th><td colspan=\"4\"><a href=http://stackoverflow.com/"$sourcepath\" title=\"$description\"><img src=http://stackoverflow.com/"$sourcepath\" width=\"72\" height=\"72\" /></a></td></tr> <tr><th>Order Now:</th><td colspan=\"4\"><a href=http://stackoverflow.com/"basket.php?action=add&id=$bikecode\">Add To Cart</a></td></tr> </table>"; } ?>\[/code\]Thank you in advance for your help.
 
Back
Top