Working script no longer works after no changes
Posted: Wed Nov 15, 2006 10:51 pm
Alright so once the $row_count value on this script was higher than 4 (currently its 5) the page no longer loads, but says it is loading and after that seems to slow down the entire webserver (my host is going to kill me).
Here is the code, its supposed to list 4 images per row, then go to the next row if there are more than 4 images and display the rest of the images.
Here is the code, its supposed to list 4 images per row, then go to the next row if there are more than 4 images and display the rest of the images.
Code: Select all
<?php
include('functions.php');
$i = 0;
while($i < $num_rows) {
$row = mysql_fetch_array( $result );
if($i == 4){
$i = 0;
echo "</tr>";
}
if($i == 0) {
echo "<tr>";
}
if($i <= 4) {
$picture = $row['photo_url'];
list($w, $h) = getimagesize($picture);
if($w > 130) {
$scale = imageScale($picture, 130, -1);
$width = $scale[0];
$height = $scale[1];
echo "<td onMouseOver=\"style.backgroundColor='#3b5998';\" onMouseOut=\"style.backgroundColor='#FFFFFF'\"><a href=\"viewphoto.php?album=" . $row['album_id'] . "&photo=" . $row['id'] . "&id=" . $row['global_id'] . "\"><img src=\"$picture\" width=\"$width\" height=\"$height\"></a></td>";
}
else
{
echo "<td onMouseOver=\"style.backgroundColor='#3b5998';\" onMouseOut=\"style.backgroundColor='#FFFFFF'\"><a href=\"viewphoto.php?album=" . $row['album_id'] . "&photo=" . $row['id'] . "&id=" . $row['global_id'] . "\"><img src=\"$picture\"></a></td>";
}
$i++;
}
}
?>