最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Smarty分列显示:有些可以变得更简单
时间:2022-07-02 10:48:21 编辑:袖梨 来源:一聚教程网
include "config/config.php";
include "config/dbclass.php";
include "include/FreeDayCodeChange.php";
$my = new mydb();
$my->c_all($db_host,$db_user,$db_psw,$db_table);
//require("include/sess.php");
$my = new mydb();
$my->c_all($db_host,$db_user,$db_psw,$db_table);
require("include/header.php");
require("config/Smarty_Freeday.php");
$smarty = new Smarty_Freeday;
$query = "select count(*) from fd_music order by MC_id desc";
$res =$my->query($query);
$total = $my->fetch_arr($res);
$total = $total[0];
$queryN = "select * from fd_music order by MC_id desc";
$result =$my->query($queryN);
$i = "0";
$j = "1";
$musicArr = array();
if ($result)
{
while ($n = $my->fetch_arr($result))
{
$i ;
$musicItem[$j-1][name] = $n[MC_name];
$musicItem[$j-1][songer] = $n[MC_songer];
$musicItem[$j-1][url] = $n[MC_url];
$j ;
if($i==$total && $j%5!=0)
{
$musicArr[] = $musicItem;
}
if($j%5 == 0)
{
$musicArr[] = $musicItem;
$musicItem = "";
$j = "1";
}
}
}
else
{
echo "
}
$smarty->assign('total',$total);
相关文章
- .net如何优雅的使用EFCore实例详解 09-16
- 在 .NET MAUI 中加载 json 文件的方法 09-16
- 基于.NET 7 的 QUIC 实现 Echo 服务的详细过程 09-16
- Morya UI:后台页面别再硬搓,交给 Agent 按规范生成 09-16
- DeepSeek 实战:从零构建 Text2SQL 数据平权应用 09-16
- 用 AI 编程时,先定方案再动手写代码 09-16