Hello gentlemen guru. Faced the most unpleasant problem: there are two tables 1. The table contains all sections and categories and has the form uid | category | razdel - where uid is a unique category identifier, category is the Russian name, razdel, respectively, is also the Russian section name. 2. The table is news with a bunch of fields, but the main one in it is the uid (only here it is already catEN)
I need to bring 5 news from each category belonging to one section.
At the moment, everything works but is very clumsy, it turns out an array in the array and the page is generated more than 1.5 seconds
$c = mysql_query("SELECT uid,nameRU FROM category WHERE nameEN='$razdel'"); if(!$c) exit('Ошибка'); while ($cat=mysql_fetch_assoc($c)) { $r = mysql_query("SELECT id,name FROM news WHERE catEN='".$cat['uid']."' order by mktime DESC LIMIT 5"); if(!$r) exit('Ошибка2'); while ($dt=mysql_fetch_assoc($r)) { } } mysql_free_result($c);