query($sql) or die($db->error); $data = $result->fetch_assoc(); $data['content'] = $purifier->purify($data['content']); $smarty->assign('article', $data); } //讀出所有文章 function list_article() { global $db, $smarty; $sql = "SELECT * FROM `article` ORDER BY `update_time` DESC"; $result = $db->query($sql) or die($db->error); $all = []; while ($data = $result->fetch_assoc()) { $all[] = $data; } // die(var_export($all)); $smarty->assign('all', $all); } ```
進階搜尋
555人線上 (209人在瀏覽線上書籍)
會員: 0
訪客: 555