Hello, the question is in optimization. Is it possible to combine 2 requests into one.
$row = mysql_query("SELECT f.total_votes, c.sub, f.total_value, c.name AS cname, f.category AS catid, f.size, f.uploader FROM xbtit_files as f LEFT JOIN xbtit_categories as c ON c.id = f.category LEFT JOIN xbtit_users as u ON f.uploader= u.id LEFT JOIN xbtit_users_level as l ON u.id_level= l.id ".$wh." ORDER BY ".$r." DESC LIMIT ".$pp.",".$a[1]); while ($b=mysql_fetch_assoc($row)){ $mc = mysql_fetch_assoc(mysql_query("SELECT `name` FROM xbtit_categories WHERE `id`=".$b['sub']));
The first query displays all the information about the file. The second query $ mc is responsible for the output of the main category. Is it possible to combine? If you do not understand something or forgot to clarify ask in the comments.