PDA

View Full Version : database problem...


N!ck
06-01-2002, 12:40 AM
this code produces one of those vBulletin "there seems to have been a slight problem with the database' errors. help!


<?
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")."\");");
?>

Admin
06-01-2002, 06:33 AM
WHERE always comes before ORDER BY:
SELECT * FROM classified_cat WHERE parent = '0' ORDER BY displayorder, title

N!ck
06-01-2002, 04:13 PM
oh, duh! i am such an idiot :D

thanks chen

N!ck
06-01-2002, 04:17 PM
okay, though...now it produces a blank page, even though i have all the templates made...any idea?

Chris M
06-01-2002, 05:18 PM
Did you add the template's name correctly to either the style or the php file?

Satan

N!ck
06-01-2002, 06:32 PM
yeah...i'm puzzled.