[CLOSED]数据库结果列 [英] [CLOSED] Database results in columns

查看:56
本文介绍了[CLOSED]数据库结果列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个新手(不到一周的PHP),我很好奇结果如何布局。是否有可能将结果列在4列?


通常


记录1到这里

记录2到这里

记录3到这里


我需要


记录1记录2记录3记录4

RECORD 5 RECORD 6等等。


如果可以,请不要忘记我真的很新。 :)


谢谢!!!

I''m a newbie (less than a week of php) and I''m curious about how results can lay out. Is it possible to have the results layed out in 4 columns?

Usual

RECORD 1 GOES HERE
RECORD 2 GOES HERE
RECORD 3 GOES HERE

I need

RECORD 1 RECORD 2 RECORD 3 RECORD 4
RECORD 5 RECORD 6 ETC.

If this is possible, please don''t forget that I''m REALLY new at this. :)

THANKS!!!

推荐答案


我'' ma newbie(不到一周的PHP),我很好奇结果如何布局。是否有可能将结果列在4列?


通常


记录1到这里

记录2到这里

记录3到这里


我需要


记录1记录2记录3记录4

RECORD 5 RECORD 6等等。


如果可以,请不要忘记我真的很新。 :)


谢谢!
I''m a newbie (less than a week of php) and I''m curious about how results can lay out. Is it possible to have the results layed out in 4 columns?

Usual

RECORD 1 GOES HERE
RECORD 2 GOES HERE
RECORD 3 GOES HERE

I need

RECORD 1 RECORD 2 RECORD 3 RECORD 4
RECORD 5 RECORD 6 ETC.

If this is possible, please don''t forget that I''m REALLY new at this. :)

THANKS!!!



答案是肯定的。有可能的。我也是一个菜鸟,所以希望有人可能有比我更好/更清洁的解决方案。我回复的唯一原因是因为我* *设法完成了与你描述的相同的效果。我怎么做可能不是最好的方式,但我的知识是有限的所以我使用我的工作。


这是我做的事情

我开始设置我的查询并获得结果和数量


然后..当它回应结果时

我声明了两个变量:标准

The answer is yes. It is possible. I am also a noob so hopefully someone might have a better/cleaner solution than I do. The only reason I am replying is because I *just* managed to accomplish the same effect that you are describing. How I did it may not be the best way available but my knowledge is limited so I work with what I have.

Here''s what I did

I started off with setting up my query and getting the results and the numrows

then..when it came to echoing the results
I declared two variables: the standard


i和


columncount存储代码或PHP TAGS之间的代码!!!!!

columncountSTORE YOUR CODE BETWEEN code or PHP TAGS!!!!!

展开 | 选择 | Wrap | 行号


这篇关于[CLOSED]数据库结果列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆