0) { //Image block $extra = ''; $tds = 0; while ($row2 = mysql_fetch_array($rst2)) { $imgbig = $row2[2].'.'.$row2[3]; $imgthumb = $row2[2].'_thumb.'.$row2[3]; $extra .= ''; $tds++; if ($tds == 7) { $extra .= ''; $tds=0; } } $extra .= '
'.$row2[1].'
'; } // End of image block // File block start $sql = "SELECT fid,ftitle,fname,fext,ftype FROM tblfiles WHERE ftype = 'file' AND fpid = $id ORDER BY fext"; $rst2 = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($rst2 ) > 0) { $extra .= '

Downloads

'; $extra .= ''; $tds = 0; while ($row2 = mysql_fetch_array($rst2)) { $filename = $row2[2].'.'.$row2[3]; switch($row2[3]) { case "pdf": $dimg = "pdf.png"; break; case "xls": $dimg = "excel.png"; break; case "xlsx": $dimg = "excel.png"; break; default: $dimg = "word.png"; break; } $extra .=''; $tds++; if ($tds == 7) { $extra .= ''; $tds=0; } } $extra .= '
'.$row2[1].'
'; } $rst = mysql_query("SELECT Pheader,Pimage,Pcontent FROM tblpages WHERE Pid = $id"); if($rst) { if(mysql_num_rows($rst) == 1) $row = mysql_fetch_assoc($rst); } else echo "Error : ".mysql_error(); } ?>