我使用YII框架,我想将MySQL查询的结果放在index.php的表中.MySQL查询已经很好了:SELECT categories.name,systemes.name,systemes.etat_de_base,maintenances.name,maintenances.date,maintenances.duree FROM sys...

我使用YII框架,我想将MySQL查询的结果放在index.php的表中.
MySQL查询已经很好了:
SELECT categories.name,
systemes.name,
systemes.etat_de_base,
maintenances.name,
maintenances.date,
maintenances.duree
FROM systemes_maintenances
LEFT JOIN systemes
ON systemes_maintenances.id_systemes = systemes.id_systemes
LEFT JOIN categories
ON systemes.id_categories = categories.id_categories
LEFT JOIN maintenances
ON systemes_maintenances.id_maintenances = maintenances.id_maintenances;
我的PHP页面目前看起来像这样:
<?php
/* @var $this SiteController */
$this->pageTitle=Yii::app()->name;
?>
<!--<h1>Welcome to <i><?php echo CHtml::encode(Yii::app()->name); ?></i></h1>
<p>Congratulations! You have successfully created your Yii application.</p>
<p>You may change the content of this page by modifying the following two files:</p>
<ul>
<li>View file: <code><?php echo __FILE__; ?></code></li>
<li>Layout file: <code><?php echo $this->getLayoutFile('main'); ?></code></li>
</ul>
<p>For more details on how to further develop this application, please read
the <a href="http://www.yiiframework.com/doc/">documentation</a>.
Feel free to ask in the <a href="http://www.yiiframework.com/forum/">forum</a>,
should you have any questions.</p>-->
<table>
<caption>État des systèmes</caption>
<tr>
<th>Catégorie</th>
<th>Nom</th>
<th>État actuel</th>
<th>Maintenance prévue</th>
<th>Début de l'incident</th>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
我想在空的< td>中显示结果. < / td>.
没有jQuery,有谁知道如何做到这一点?
解决方法:
由于您使用的是Yii框架,因此可以使用CGridView组件.这提供了一组很好的功能,例如排序,分页和过滤.
检查以下链接以获取示例用法.
http://www.yiiplayground.com/index.php?r=UiModule/dataview/gridView
本文标题为:php – 将MySQL查询的结果动态显示到HTML页面中


基础教程推荐
- ajax判断后端返回的数据是否为null的方法 2023-02-14
- vue动态渲染img,图片不显示 2023-10-08
- Ajax+php实现商品分类三级联动 2023-01-20
- 如何将vue中markdownr组件mavon-editor内容转换成html并渲染样式 2023-10-08
- Vue3.0 性能提升主要是通过哪几方面体现的? 2023-10-08
- ajax无刷新分页的简单实现 2022-12-28
- Ajax实现模拟关键字智能匹配搜索效果 2023-01-26
- 补码原码反码··原文:https://www.cnblogs.com/goahead--linux/p/10904701.html 2023-10-25
- mysql / php – 在数据库中存储html模板 2023-10-25
- vue引入html2canvas插件实现图片嵌入div展示下载 2023-10-08