If I need to display 80 thousand records from one table in the database, and for each record, substitute a header from the second table, then how is it most practical for me to do so that there are no problems with the RAM on the server and other concerns. I would like to know by what vectors to search for information.
Here is what I can do at the moment:
$komrads = DbQuery::fetchAll("SELECT * FROM everyone_in_andorra"); foreach ($komrads as $komrad) { $vernacular = DbQuery::fetchOne("SELECT language FROM kgb_list WHERE komradid = '".$komrad['id']."' LIMIT 1"); if (!$vernacular) { echo $komrad['id']."<br> Не владеет языками"; } else { echo $komrad['name']." - ".$vernacular['language']."<br>"; } }
select id, name, (select language from kgb_list where komradid=A.id limit 1) as lang from everyone_in_andorra A
- Mikeне владеет языками
second request? - avp