I have code to generate four cars from a DB with their photos:
$l=$database->query("SELECT car,brand,exactprice FROM $table ORDER BY rand() LIMIT 4");
$buffer="";
foreach($l as $l){
$buffer.="<li><h3>{$l['car']}</h3><p>Price {$l['exactprice']}</p>";
$k=$database->query("SELECT logo FROM logo WHERE brand='{$l['brand']}'");
$buffer.="<img src='{$base_addr}/{$k[0]['logo']}'><br>";
}
That's my current code. Can I rewrite my MySQL command so I would get logo
from the logo
with the first select I did?
Currently it takes 4.32 seconds to load this page.