多表查詢+多表標題鏈接的調用
[e:loop={ "select a.*,b.gsjc from phome_ecms_news a LEFT JOIN phome_ecms_gssj b on a.gsid=b.id where a.classid in (8)??order by a.newstime desc limit 1",5,24,0}]
以上A為第一個表 B為第二個表
" target="_blank"><?=$bqr[title]?>??這個是第一個表的標題鏈接及標題fetch1("select titleurl,groupid,classid,newspath,filename,id from??phome_ecms_gssj??where id='$bqr[gsid]' limit 1");? ? ? ? $titleurl=sys_ReturnBqTitleLink($r);echo $titleurl;?> ">? ?這個是第二個表的標題鏈接 <?=$bqr[gsjc]?>? ?這個是第二個表的標題 [/e:loop]
第二個表的標題鏈接藍色部分不用修改 ID 對應第一個查詢的ID即可
新聞熱點
疑難解答