Configuration file
<?PHPreturn Array( ' Db_type ' = ' mysql ',//Database Type' db_host ' = ' localhost ',//Server Address' Db_name ' = ' 819 ',//Database name' Db_user ' = ' root ',//User name' Db_pwd ' = ' root ',//Password' Db_port ' = 3306,//Port' Db_prefix ' = ' xp_ ',//database table Prefixes );?>
Control files
<?PHP//This class is automatically generated by the system and is intended for testing purposes onlyclassIndexactionextendsAction { Public functionindex () {//instantiate an empty model with no data tables $Dao=M (); //or use $Dao = new Model (); $list=$Dao->query ("Select Xp_wztj.bt,xp_wztj.time,xp_wztj.gjz,xp_wztj.wz,xp_wzfl.name from XP_WZTJ, XP_WZFL WHERE xp_ Wztj.uid = xp_wzfl.id ORDER BY xp_wztj.id Desc "); $this->assign (' Alist ',$list ); $this-display (); //$WZ = M ("WZTJ");//Instantiate User object//$list =//$WZ->field ("Bt,time,gjz,wz")->order (' id ')->select (); $this->assign (' alist ', $list); $this->display (); Dump ($data);}}
Show Files
<foreach name= "alist" item= "vo" ><div style=border-style:groove> title: {$vo. BT}<div style=border-style:groove> time: {$vo. Time} | Category: {$vo. Name} | Keyword: {$vo. Gjz}<div style=border-style:groove>{$vo. Wz}</div></div></div ><br><br><br><br></foreach>
thinkphp Front desk Test