model方法: 复制代码 代码如下: public static function get_forum_name_by_fid($fid) { $sql = "SELECT name FROM sq_forums WHERE fid='$fid' ORDER BY threads_counter DESC"; $data = pm_db11::result_first($sql); return $data; } public static function get_ajx_forum_by_tpid($tpid, $fid) { //产品ID:tpid,版块ID:fid $data = array(); if($tpid && $fid){//构造一个id字段,也可以通过对查询结果加工构造 $sql = "SELECT fid AS id,fid,name FROM sq_forums WHERE tpid='$tpid' AND name LIKE N'%$fid%' ORDER BY threads_counter DESC"; $query = pm_db11::query($sql); $data = pm_db11::fetch_all($query); } return $data; }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn