Kinox
06-29-2002, 06:11 PM
ok, this code generates too many queries, how can I lower it down?
for every usertitle it generates 1 queries, leats say I have 15 replys in 1 thread, that will generate 15 queries...
is there a way to lower it down?
global $DB_site;
$gettitles = $DB_site->query_first("SELECT minposts,image,setimages FROM usertitle WHERE minposts<=$post[posts] ORDER BY minposts DESC LIMIT 1");
if ($post[posts] > $gettitles[minposts]) {
$findusertitle = "<br>";
for ($i=0; $i<$gettitles[setimages]; $i++) {
$findusertitle .= "<img src=\"https://vborg.vbsupport.ru/greentek/titles/$gettitles[image].gif\">";
} // end if
} // end if
$post[usertitle] .= $findusertitle;
for every usertitle it generates 1 queries, leats say I have 15 replys in 1 thread, that will generate 15 queries...
is there a way to lower it down?
global $DB_site;
$gettitles = $DB_site->query_first("SELECT minposts,image,setimages FROM usertitle WHERE minposts<=$post[posts] ORDER BY minposts DESC LIMIT 1");
if ($post[posts] > $gettitles[minposts]) {
$findusertitle = "<br>";
for ($i=0; $i<$gettitles[setimages]; $i++) {
$findusertitle .= "<img src=\"https://vborg.vbsupport.ru/greentek/titles/$gettitles[image].gif\">";
} // end if
} // end if
$post[usertitle] .= $findusertitle;