欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

thinkPHP HTML输出多条查询结果

程序员文章站 2022-07-08 19:50:53
控制端 $select=M('Baojiao')->query("select * from think_Baojiao where COMPANY='$comname'"); if(!empty($select)){ $this->assign('inf',$select);//assign_di ......

控制端

$select=m('baojiao')->query("select * from think_baojiao where company='$comname'");

                            if(!empty($select)){

                                     $this->assign('inf',$select);//assign_display连用

                                     $this->display("showbjck");}

assign获取select数据集,display展示

视图html端

<volist name="inf" id="list">

<tr>

        

         <td><input type="text" readonly="readonly" name="utel" size="25" style="font-size:12px;text-align:center;width:110px;" value={$list.company}></td>

         <td><input type="text" readonly="readonly" name="utel" size="25" style="font-size:12px;text-align:center;width:110px;" value={$list.writename}></td>

         <td><input type="text" readonly="readonly" name="utel" size="25" style="font-size:12px;text-align:center;width:110px;" value={$list.writetime}></td>

         <td><input type="text" readonly="readonly" name="utel" size="25" style="font-size:12px;text-align:center;width:110px;" value={$list.proname}></td>

         <td><input type="text" readonly="readonly" name="utel" size="25" style="font-size:12px;text-align:center;width:110px;" value={$list.proprice}></td>

         <td><input type="text" readonly="readonly" name="utel" size="25" style="font-size:12px;text-align:center;width:660px;" value={$list.proinfo}></td>

         <td><input type="text" readonly="readonly" name="utel" size="25" style="font-size:12px;text-align:center;width:550px;" value={$list.addinfo}></td>

         <!--绝对路径<td><img alt="" src="http://localhost:8080/mytp/2/image/logo.png" width="20" height="20"/></td>-->

         <!-- 绝对路径,相对路径-->

         <td><img alt="" src="../../../image/logo.png" width="20" height="20"/></td>

        

</tr>

</volist>

上一篇: 冬天天冷

下一篇: 让我辞职