krohnathlonman
04-17-2004, 11:38 PM
$cathandle = mysql_query("SELECT * FROM amartincats ORDER BY id ASC");
$count = mysql_num_rows($cathandle);
while($count>0)
{
$catdata = mysql_fetch_array($cathandle);//get category data
$catstitle = $catdata[name];
//loop through articles of given category
$ahandle = mysql_query("SELECT id, subject, subject_2 FROM amartin WHERE category = '".$catdata[id]."' ORDER BY subject ASC");
$acount = mysql_num_rows($ahandle);
while($acount>0)
{
$adata = mysql_fetch_array($ahandle);
$populars['subject'] = $adata[subject];
$populars['id'] = $adata[id];
$populars['subject_2'] = $adata[subject_2];
$acount--;
}//end article loop
eval("\$cats1bit .= \"".fetch_template('article_list_bit')."\";");
//echo($cats1bit); //do whatever has to be done to put in in the template :)
unset($cats1bit);
$count--;
eval("\$article[cat1] .= \"".fetch_template('article_cat1')."\";");
}
//end main cat loop
This is for my article system that I'm preparing to release.... I just can't seem to grab the data and cycle through the lists properly :(
$count = mysql_num_rows($cathandle);
while($count>0)
{
$catdata = mysql_fetch_array($cathandle);//get category data
$catstitle = $catdata[name];
//loop through articles of given category
$ahandle = mysql_query("SELECT id, subject, subject_2 FROM amartin WHERE category = '".$catdata[id]."' ORDER BY subject ASC");
$acount = mysql_num_rows($ahandle);
while($acount>0)
{
$adata = mysql_fetch_array($ahandle);
$populars['subject'] = $adata[subject];
$populars['id'] = $adata[id];
$populars['subject_2'] = $adata[subject_2];
$acount--;
}//end article loop
eval("\$cats1bit .= \"".fetch_template('article_list_bit')."\";");
//echo($cats1bit); //do whatever has to be done to put in in the template :)
unset($cats1bit);
$count--;
eval("\$article[cat1] .= \"".fetch_template('article_cat1')."\";");
}
//end main cat loop
This is for my article system that I'm preparing to release.... I just can't seem to grab the data and cycle through the lists properly :(