PDA

View Full Version : Display a list


krohnathlonman
04-10-2004, 09:21 PM
I want to display a list inside of a PHP page.

Here's my Query, I just want display the list.....
<?php

$guide = $DB_site->query("SELECT id, subject, subject_2 FROM amartin WHERE category = 'guide' ORDER BY subject ASC");


while (list ($id, $subject, $topic) = mysql_fetch_row($guide)) {
echo "<tr><td width=50%><a href=articles.php?aid=$id&page=1&topic=$topic>$subject</a></td></tr>\n";

}
?>

Whats the proper way of doing this in VBulletin?

krohnathlonman
04-10-2004, 10:21 PM
Here's what I've got so far:


$pop = $DB_site->query("SELECT id, subject FROM amartin ORDER BY views DESC LIMIT 5");
while($popular = $DB_site->fetch_array($pop)) {

$populars['subject'] = $popular['subject'];
$populars['id'] = $popular['id'];
}
eval("\$popularbit .= \"".fetch_template('article_list_bit')."\";");

eval("\$article[popular] = \"".fetch_template('article_pop')."\";");
unset($popular);
$DB_site->free_result($pop);

What else Do I need for it to display the list? I only get the very last item of the list..... It's just not looping right :( what I miss?

krohnathlonman
04-12-2004, 09:10 PM
anybody?

NTLDR
04-12-2004, 09:35 PM
eval("\$popularbit .= \"".fetch_template('article_list_bit')."\";");

The above line should be within the while loop :)