精華 帝國PHP系統用SQL方式讀取任何表中的任何字段
<p>帝國用SQL方式讀取任何表中的任何字段</p>
欄目封面、列表模板,要讀取當前欄目的欄目內容,直接用PHP讀取出來:
<?php
$cr=$empire->fetch1("select classtext from phome_enewsclassadd where classid='$GLOBALS[navclassid]'");
echo $cr['classtext'];
?>
用靈動標簽[e:loop]:
[e:loop={"select classtext from phome_enewsclassadd where classid='$GLOBALS[navclassid]'",1,24,0}]
<?=$bqr[classtext]?>
[/e:loop]
其中$GLOBALS[navclassid]表示當前欄目ID