如...
我有个表 category (分类表)
id,name有个 mall(商城分类)
id,team_id (项目ID), category_id (分类表id)还有 team (项目)
id,name,mall_id(商城分类id)我想在模板页面上实现 栏目(关联--分类表)
在页面上显示 分类表 里新建的 类目. 一栏一览的..这个我能实现.
<!--{loop (数组) $index $one}-->
<div>
</div>
<!--{/loop}-->
问题是..
这个栏目里.显示对应的 项目.
可以用下面的方法吗?
<!--{loop (数组) $index $one}-->
<div>
栏目
<ul>
<!--{loop (数组) $index $one}-->
<li>
我是内容
</li>
<!--{/loop}-->
</ul>
</div>
<!--{/loop}-->
主要是 不同 栏目 显示不同项目...
求...思路...求教育...
我有个表 category (分类表)
id,name有个 mall(商城分类)
id,team_id (项目ID), category_id (分类表id)还有 team (项目)
id,name,mall_id(商城分类id)我想在模板页面上实现 栏目(关联--分类表)
在页面上显示 分类表 里新建的 类目. 一栏一览的..这个我能实现.
<!--{loop (数组) $index $one}-->
<div>
</div>
<!--{/loop}-->
问题是..
这个栏目里.显示对应的 项目.
可以用下面的方法吗?
<!--{loop (数组) $index $one}-->
<div>
栏目
<ul>
<!--{loop (数组) $index $one}-->
<li>
我是内容
</li>
<!--{/loop}-->
</ul>
</div>
<!--{/loop}-->
主要是 不同 栏目 显示不同项目...
求...思路...求教育...
解决方案 »
- 用socket发邮件 有个问题
- 求助一个分页问题
- windows xp 下安装apache时出现未能绑定80端口的错误
- php验证码问题
- INSERT INTO `news` SELECT * FROM `news`,news中含有唯一索引的ID字段时,怎么办?
- 想问一下仓库管理系统的实现思想是什么
- 谁用过MySQL Administrator啊?他不支持中文怎么解决啊?
- ereg("^php[0-9A-Za-z_.-]+$", basename($attachment))前面的php是什么意思?
- faint我在apache下输入网页地址css就无效!!
- 使用laravel创建数据库 migrate
- [求修改]我也不知道这个是不是C语言的
- linux+apache php的file_get_content方法,第一次响应慢的问题?
上面的是 分栏$b=Array ( [0] => Array ( [id] => 38 [user_id] => 1 [title] => 111111222222 [summary] => 啊啊啊啊啊啊
[city_id] => 0 [group_id] => 39 [mall_id] => 41 [partner_id] => 0 [system] => Y [team_price] => 1.00 [et_price] => 1.00 [product] => 11111122222222 [condbuy] => [per_number] => 0 [min_number] => 10 [max_number] => 0 [now_number] => 0 [pre_number] => 0 [image] => [image1] => [image2] => [flv] => [mobile] => [credit] => 0 [card] => 0 [fare] => 0 [farefree] => 0 [bonus] => 0 [address] => [detail] => [systemreview] => [userreview] => [notice] => 1
[express] => [delivery] => express [state] => none [conduser] => N [buyonce] => Y [team_type] => normal [sort_order] => 0 [expire_time] => 1308412800 [begin_time] => 1300377600 [end_time] => 1304092800 [reach_time] => 0 [close_time] => 0 [seo_title] => [seo_keyword] => [seo_description] => [notice1] => [notice2] => [notice3] => [notice4] => [smallimage] => [smallimage1] => [smallimage2] => [nav_id] => 0 [otherimage] => [purchase] => 0.00 [jytime] => 0000000000 [jiayou] => 0 [true_number] => 0 [true_totle] => 0.00 [bar_image1] => team/2011/0411/13025106403528.jpg ) )$b 是项目上面分栏的ID 关联 项目中 mall_id foreach ($a as $key=>$value){
这里显示了. 所有的 分栏
}
我想在 这循环中 在加一次循环. 显示出 这个栏目下所有的 对应ID的项目因为 栏目不同..所以 id 也是不一样...
foreach ($a as $key=>$value){
这里应该怎么 循环 $b
}大概意思就是这样的....哪位高手...帮助一下..帮我理一下思维...求..教育额~~~
for(i=0;i<count($arr);i++){
$teams=query(select * from team id in (select team_id from mall where category_id=$arr[id]));
$arr['teams'][]=$teams;
}
不知道符合不
是 for($i=0;$i<count($arr);$i++){
$teams=query(select * from team id in (select team_id from mall where category_id=$arr[id]));
$arr['teams'][]=$teams;
}是这样么?
上面的是 分栏这个分栏的...数组...额...主要是..都是用ID 控制..所以 循环里加 条件循环...
$b 是 项目数组.
mall_id 对应 栏目的 id
最外面 显示所有 栏目. 栏目里面 显示对应 的 id 的项目...