Harlequin
01-28-2004, 10:01 AM
I'm beginning to get a little confused by something. Maybe my query needs to be changed for this.
In a nutshell, what is the difference between :
$cc = $DB_site->query(" SELECT * FROM tagio ");
while ( $cy = $DB_site->fetch_array ( $cc ) ) :
$taglist = "$cy[tags]";
endwhile;
// calling $taglist in the template
eval("dooutput(\"".gettemplate("cc_tag_test")."\");");
or
$cc = $DB_site->query(" SELECT * FROM tagio ");
while ( $cy = $DB_site->fetch_array ( $cc ) ) :
$taglist = "". $cy[tags] ."<br>";
endwhile;
// calling $taglist in the template
eval("dooutput(\"".gettemplate("cc_tag_test")."\");");
when compared to:
$cc = $DB_site->query(" SELECT * FROM tagio ");
while ( $cy = $DB_site->fetch_array ( $cc ) ) :
echo "$cy[tags]";
endwhile;
??
The problem is $taglist=""; in the template isn't calling the loop -- only the first result of the loop, while echo=""; calls everything in the loop fine and as it should.
I need the looped results to display in the template using $taglist - but apparently I'm doing something wrong here.
PS. Moved and erased this from another thread - was off-topic to that particular thread.
In a nutshell, what is the difference between :
$cc = $DB_site->query(" SELECT * FROM tagio ");
while ( $cy = $DB_site->fetch_array ( $cc ) ) :
$taglist = "$cy[tags]";
endwhile;
// calling $taglist in the template
eval("dooutput(\"".gettemplate("cc_tag_test")."\");");
or
$cc = $DB_site->query(" SELECT * FROM tagio ");
while ( $cy = $DB_site->fetch_array ( $cc ) ) :
$taglist = "". $cy[tags] ."<br>";
endwhile;
// calling $taglist in the template
eval("dooutput(\"".gettemplate("cc_tag_test")."\");");
when compared to:
$cc = $DB_site->query(" SELECT * FROM tagio ");
while ( $cy = $DB_site->fetch_array ( $cc ) ) :
echo "$cy[tags]";
endwhile;
??
The problem is $taglist=""; in the template isn't calling the loop -- only the first result of the loop, while echo=""; calls everything in the loop fine and as it should.
I need the looped results to display in the template using $taglist - but apparently I'm doing something wrong here.
PS. Moved and erased this from another thread - was off-topic to that particular thread.