$d) { if($d["id"] > 0) $db->edit($db->tables->$t, $d, "id = '".$d["id"]."'"); else $db->add($db->tables->$t, $d); } ?> Nina Bogh
tables->contents." WHERE title LIKE '%".$a."%'"; $d = $db->query($q); } if($d) { if($login > 0) { $contents = $d[0]; include ("editcontents.inc.php"); $contents = ""; } else $contents = $d[0]; } else { $int = (is_numeric($a)) ? true : false; $w = ($int) ? "id < $a" : ""; $order = ($a == "fact" || $int) ? "order by id desc" : "order by RAND()"; if(!$a) $order = "order by id asc"; $d = $db->get($db->tables->facts, $w, "$order limit 0,1"); if($int && !$d) $d = $db->get($db->tables->facts, "", "order by id desc limit 0,1"); $fact = $d[0]; } } ?>