per me l'importante e' apprendere e un giorno,quando non importa ,ma un giorno imparare.
Grazie ancora,della disponibilita',pazienza ,e professionalita'.
Grazie Micogian.


Il BEGIN fa proprio quello, per ogni valore inserisce una riga.slash ha scritto:Grazie micogian, solo una cosa come ti ho detto ho bisogno di inserire un singolo risultato in un div
ad esempio:
<div> totale post forum id 3</div>
<div> totale post forum id 4</div>
<div> totale post forum id 5</div>
come si fa?
ho bisogno di tante query quanti sono i div è corretto?
grazie mille per l aiuto!
Codice: Seleziona tutto
<div>{tot_topics.FORUM_TOPICS} topics nel Forum {tot_topics.FORUM_ID} = {tot_topics.FORUM_NAME}</div>
Codice: Seleziona tutto
//topic
$sql = "SELECT forum_id, forum_name, forum_topics
FROM " . FORUMS_TABLE . "
WHERE forum_id IN(2)
ORDER BY forum_topics DESC";
$result = $db->sql_query($sql);
$x = 0;
while ($row = $db->sql_fetchrow($result))
{
$forum_id[$x] = $row['forum_id'] ;
$forum_name[$x] = $row['forum_name'] ;
$forum_topics[$x] = $row['forum_topics'] ;
++$x;
}
for ($i=0; $i < $x; ++$i)
{
$template->assign_block_vars('tot_topics',array(
'FORUM_TOPICS' => $forum_topics[$i]
));
}
//topic1
$sql = "SELECT forum_id, forum_name, forum_topics
FROM " . FORUMS_TABLE . "
WHERE forum_id IN(1)
ORDER BY forum_topics DESC";
$result = $db->sql_query($sql);
$x = 0;
while ($row = $db->sql_fetchrow($result))
{
$forum_id[$x] = $row['forum_id'] ;
$forum_name[$x] = $row['forum_name'] ;
$forum_topics[$x] = $row['forum_topics'] ;
++$x;
}
for ($i=0; $i < $x; ++$i)
{
$template->assign_block_vars('tot_topics',array(
'FORUM_TOPICS1' => $forum_topics[$i]
));
}
Codice: Seleziona tutto
<!-- BEGIN tot_topics -->
<div>{tot_topics.FORUM_TOPICS}</div>
<!-- END tot_topics -->
<!-- BEGIN tot_topics -->
<div>{tot_topics.FORUM_TOPICS1}</div>
<!-- END tot_topics -->
Visitano il forum: Nessuno e 41 ospiti