$query = "select * from theme where (serial='$th_serial')";
$result = mysql_query($query ,$db);
$count = mysql_num_rows($result);
$trow = mysql_fetch_array($result);
print "
".UE($trow[name])."
\n";
print "
\n";
print "
".UE($trow[com])."
\n";
print "
\n";
print "
\n";
print "
\n";
$query2 = "select * from category where lev=1 order by num";
$result2 = mysql_query($query2 ,$db);
$count2 = mysql_num_rows($result2);
if ($count2 > 0) {
while ($row2 = mysql_fetch_array($result2)) {
////$query3 = "select * from items where (lev='1') and (theme='$th_serial') and (category='$row2[serial]') and (photo1 != '') order by num limit 1";
//$query3 = "select * from items where (lev='1') and (theme='$th_serial') and (category='$row2[serial]') order by num limit 1";
$query3 = "select * from items where (lev='1') and (theme='$th_serial') and (category='$row2[serial]') order by rand() limit 1";
$result3 = mysql_query($query3 ,$db);
$row3 = mysql_fetch_array($result3);
if (!empty($row3)) {
print "
\n";
$path3 = "../items_photo/$row3[photo1]";
if (($row3[photo1])&&(file_exists($path3))) {
//print " ![\"".UE($row2[name])."\"](\"$path3\")
\n";
print " ![\"".UE($row2[name])."\"](\"$path3\")
\n";
} else {
print " -
\n";
}
print " - ".UE($row2[name])."
\n";
print " - ".UE($row2[com])."
\n";
print "
\n";
}
}
}
?>