DjSap
02-27-2002, 11:36 AM
Im trying to make a classifieds hack for my board and i want to list all results in a table, it works fine but i can't get the row colors to alternate so that both second and firstaltcolor is used, ive tried to do it according to some tutorials but it doesnt seem to work on vb.
This is my query for displaying a list of the ads
$clsbit = $DB_site->query("SELECT adid, price, userid, title, timeline, category FROM classified ORDER BY adid DESC LIMIT 5");
while ($admessage=$DB_site->fetch_array($clsbit)) {
$adid = $admessage[adid];
$userid = $admessage[userid];
$date = vbdate("m-d-Y H:i",$admessage[timeline]);;
$title = $admessage[title];
$price = $admessage[price];
$catid = $admessage[category];
$userinfo=getuserinfo($userid);
$cat=$DB_site->query("SELECT category FROM classified_category WHERE catid='$catid'");
list($category) = mysql_fetch_row($cat);
eval("\$classifiedbit .= \"".gettemplate("classifiedbit")."\";");
}
So could someone tell me what i should write to get alternating row colors working.
This is my query for displaying a list of the ads
$clsbit = $DB_site->query("SELECT adid, price, userid, title, timeline, category FROM classified ORDER BY adid DESC LIMIT 5");
while ($admessage=$DB_site->fetch_array($clsbit)) {
$adid = $admessage[adid];
$userid = $admessage[userid];
$date = vbdate("m-d-Y H:i",$admessage[timeline]);;
$title = $admessage[title];
$price = $admessage[price];
$catid = $admessage[category];
$userinfo=getuserinfo($userid);
$cat=$DB_site->query("SELECT category FROM classified_category WHERE catid='$catid'");
list($category) = mysql_fetch_row($cat);
eval("\$classifiedbit .= \"".gettemplate("classifiedbit")."\";");
}
So could someone tell me what i should write to get alternating row colors working.