query($sql) or die($db->error); $data = $result->fetch_assoc(); $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); } ```
進階搜尋
582人線上 (197人在瀏覽線上書籍)
會員: 0
訪客: 582