PDA

View Full Version : Empty datas to display in a template ?


grog6
06-05-2003, 10:53 PM
Well, I'm trying to do this modification of my hack :

https://vborg.vbsupport.ru/showthread.php?postid=404394#post404394

But that's what I get on my forum :(
I use this code :

$classes=$DB_site->query("SELECT * FROM usertitleclass ORDER BY displayorder");
while ($classe=$DB_site->fetch_array($classes)) {


$titles=$DB_site->query("SELECT * FROM usertitle WHERE usertitleclass='$classe[usertitleclassid]' ORDER BY minposts");
while ($title=$DB_site->fetch_array($titles)) {

if ($j == 1) $color2 = "#1C5780";
else $color2 = "#13486D";

eval("\$liste .= \"".gettemplate('usertitles_liste')."\";");
$j = $j + 1;
if ($j == 2) $j=0;
}

eval("\$clas .= \"".gettemplate('usertitles_class')."\";");
}

Why does it display all previous datas from the usertitle's table whereas only those who has the same userstylecass equal to the userstyleclassid of my userclass' table would be shown :confused:

I've tried using a free_result without success .....

Any idea ?

grog6
06-05-2003, 10:54 PM
Here is the content of my usertitle's table

grog6
06-05-2003, 10:56 PM
And here is the content of my userclass' table :angry:

I'd like to understand at least why it show me all previous datas from the usertitle's table :tired:

Thx

Xenon
06-06-2003, 10:37 AM
because:
eval("\$liste .= \"".gettemplate('usertitles_liste')."\";");
$liste is never been set to '' for the next class...

add before $titles=$DB....
$liste = '';

:)

grog6
06-06-2003, 11:35 AM
Thx Xenon, I try it :)

grog6
06-06-2003, 11:51 AM
It works perfect !
Thx Xenon :)

Xenon
06-06-2003, 11:59 AM
you're welcome