在 HTML 页面中重复某个区域
我一直在尝试学习 PHP 重复区域...我搜索了 google 但遇到了非常复杂的代码示例,eg & 例如,我希望有人能提供一个简单的代码示例...就像我正在做的那样,
我有一个查询,它获取结果并生成一个包含结果的列表
$results = mysql_query("SELECT names,age,nic FROM t_able WHERE state='1'");
<ul>
// The the targeted repeat region starts here
<li>
//my data
</li>
// The target repeat region ends here
</ul>
,我知道我可以用循环来完成此操作,但为什么在重复区域功能存在时还要麻烦...为什么不学习...
ps这个问题是为了让学习变得简单,因为这是一个编程问题,所以不要投票否决:)或投票关闭它;p
i have been trying to learn PHP Repeat Region... i have searched google but came across very complicated code samples, e.g & e.g, i would like if somebody be kind enough to provide a simple code sample... like what i am doing is
i have a query which gets results and makes a list with result
$results = mysql_query("SELECT names,age,nic FROM t_able WHERE state='1'");
<ul>
// The the targeted repeat region starts here
<li>
//my data
</li>
// The target repeat region ends here
</ul>
i know i can do this with a loop but why bother when repeat region functionality is there...why not learn...
p.s. this question is to make the learning simple and AS it is a programming question don't vote down :) or vote to close it ;p
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这样的事情还不够吗?我不认为没有框架和视图助手会更简单。
Something like that is not enough? I dont think there is simpler without a framework and viewhelpers.
这是一个简单的循环,通常在编程的早期就已经学会了。您可能听说过一些奇怪的术语,这些术语只会让事情变得比实际需要的更加复杂。
This is a simple loop, which one usually learns quite early on in programming. You may have heard some strange terminology that's just making this more complex than it needs to be.