$sql21 = "select * from category order by name";
$result21 = mysql_query($sql21);
$count21 = mysql_num_rows($result21);
$td = "";
$n=0;
while ($record21 = mysql_fetch_array($result21)){
$n++;
if ($n == 9 || $n == 16 ){
print ' |
';
}
$sql22 = "select * from category_images where cs_code REGEXP '$record21[code][0-9][0-9]'";
$result22 = mysql_query($sql22);
$count22 = mysql_num_rows($result22);
$sql23 = "select * from subcategory where category_code='$record21[code]' order by name";
$result23 = mysql_query($sql23);
$count23 = mysql_num_rows($result23);
if ($n != 1 || $n!= 9 || $n!=16 ){
print '';
}
$str = $record21['name'];
$str1 = preg_replace("[& ]", '', $str);
$str1 = preg_replace("[-]", '', $str1);
$str1 = preg_replace("[ ]", '_', $str1);
$str1 = 'Category_Website_Templates_' . $str1 . "-$record21[code]-00.html";
print '';
$n2 = 0;
while ($record23 = mysql_fetch_array($result23)){
$n2++;
$sql24 = "select * from category_images where cs_code REGEXP '$record21[code]$record23[code]'";
$result24 = mysql_query($sql24);
$count24 = mysql_num_rows($result24);
$str = $record23['name'];
$str2 = preg_replace("[& ]", '', $str);
$str2 = preg_replace("[-]", '', $str2);
$str2 = preg_replace("[ ]", '_', $str2);
$str2 = 'Category_Website_Templates_' . $str2 . "-$record21[code]-$record23[code].html";
print '';
}
if ($n == 8 || $n == 15 ){
print ' |
| ';
}
}
?>