This only shows one image. How I can get it to loop and show all it's images
<?php
mysql_connect (**, **, **);
mysql_select_db (**);
$result = mysql_query ("SELECT * from **_trips where trip_id = $trip_id");
while ($row = mysql_fetch_array($result)) {
$pid = $row[id];
$result5 = mysql_query ("SELECT * from **_trips where id = $pid");
$row5 = mysql_fetch_array($result5);
$filename = $row5["url"];
$percent = 0.12;
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = $width * $percent;
$newheight = $height * $percent;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Output
imagejpeg($thumb);
}
?>