I am trying to display around 1000 .jpg images of size 30 kb each (in average). Let me show the script first :
<?php
ini_set('display_errors', 1);
// database connection files
include '../../lib/config.php';
include '../../lib/opendb.php';
set_time_limit (9999); // to increase execution time for large upload database//
// allow access to page
$showandsave = false; // choosen to view and save the images
if(isset($_POST['submit_html'])){
$showandsave = true;
}
$reportdatefrom = $_REQUEST['reportdatefrom'];
$reportdateto = $_REQUEST['reportdateto'];
// Prepare Constant Query for Master List
$qry_const = "select";
$qry_const .= " "."a.photoname";
$qry_const .= " "."from applicants a";
$qry_const .= " "."where a.date_of_admission between '$reportdatefrom' and '$reportdateto'";
$rs = mysql_query($qry_const) or die("Error Fetching List : ".mysql_error());
$gridsize = 10;
$r = 0;
echo "<table>";
while($row = mysql_fetch_assoc($rs)){
++$r;
if($r == 1 || ($r-1)%$gridsize == 0)
echo "<tr>";
echo "<td><img src='".$row['photoname']."' height='100px' width='75px'/></td>";
if($r%$gridsize == 0)
echo "</tr>";
}
echo "</table>";
?>
While the number of images is less say around 20, no error occurs and the script works perfectly fine. But as the number exceeds say 200 then "500 Internal Server Error" is coming up. How to cop up with this situation? Please suggest a remedy.