this code produces one of those vBulletin "there seems to have been a slight problem with the database' errors. help!
PHP Code:
<?
chdir("../forums");
require("global.php");
$cats = $DB_site->query("SELECT * FROM classified_cat ORDER BY displayorder, title WHERE parent = '0'");
while ($cat = $DB_site->fetch_array($cats)) {
eval("\$catbit .= \"".gettemplate("classifieds_indexbit_level1")."\";");
$subcats = $DB_site->query("SELECT * FROM classified_cat WHERE parent = '".$cat[id]."' ORDER BY displayorder, name");
while ($subcat = $DB_site->fetch_array($subcats)) {
eval("\$catbit .= \"".gettemplate("classifieds_indexbit_level2")."\";");
}
}
echo $catbit;
eval("dooutput(\"".gettemplate("classifieds_index")."\");");
?>