Hi,
I have some code in my theme.php to extract random/latest image data for use in my layout. It's for a high traffic website with limited resources, but it runs the existing unmodified system fine. My code is:
$randoms = 2;
for($i=0; $i < $randoms; $i++){
$image = get_pic_data('random', $count, $album_name, 0, 1, false);
$image = current($image);
$random_images .= "<a href=\"displayimage.php?album=".$image['aid']."&pos=-{$image['pid']} \">".
"<img src=\"" . get_pic_url($image, 'thumb') . "\" ".
"class=\"leftmenuimage\"\></a><br /><br />";
}
//Get some latest images
$latest_images = "";
$latests = 2;
$images = get_pic_data('lastup', $count, $album_name, 0, $latests, false);
for($i=0; $i < $latests; $i++){
$image = $images[$i];
$latest_images .= "<a href=\"displayimage.php?album=".$image['aid']."&pos=-{$image['pid']} \">".
"<img src=\"" . get_pic_url($image, 'thumb') . "\" ".
"class=\"leftmenuimage\"\></a><br /><br />";
}
I then pass $random_images and $latest_images as {RANDOM_IMAGES} and {LATEST_IMAGES} to the template parser. All is well on the test system, but when I put it live it crashes the database with the max_user_connections issue. Any idea what could be causing it? It's my understanding that this code shouldn't require any more database connections than before (and just so nobody suggests it, I was using cpmFetch but it caused exactly the same problem).
I'd probably get into trouble for dumping the whole phpinfo here, although I can get it if people think it might be relevant. max_user_connections is currently 64 and won't be raised due to cost issues.
Thanks,
Douglas
I can't see how that code is supposed to cause that error. It's probably caused by some other modification. Have you modified get_pic_url() atall? Can you post a link?