Hi guys,
I have written this code that will convert the images in Path1 to thumbs and will copy it to Path2. In the image folder there are more than 100 images. However this code will convert the first 5 images and will stops!
If I remove the "createThumb" part of the code and only echo the file names, it will work great. I also used the "foreach" rather than "for" loop still the same problem!
Anyone with any help or idea greatly appreciated…
<?php
$h = 75;
$w = 125;
$path1 = ($rootpath.'images/');
$path2 = ($rootpath.'images/thumb/');
$sql = "SELECT `pic` FROM `album`";
$sql_result = mysql_query($sql);
$num_rows = mysql_num_rows($sql_result);
for ($i=0; $i <= $num_rows -1; $i++) {
$row = mysql_fetch_array($sql_result);
$filename = $row['pic'];
if(createThumb($filename, $w, $h, $path1, $path2, $filename)) {
echo "Created Thumb: $filename <br>";
}
}
?>
Thanks,
Steve