Posts | ||
---|---|---|
A question on PHP and mysql | Locked | |
Thread Options | ||
|
Apr 4 2004 Anchor | |
i currently have my gallery section throwing the links all in a line. however, i want it to insert a line break after every 5 links. i would want it to look like | link | link | link | link | link | that ^ the only problem is im not quite sure how to go about doing that. the code i have now is...
any help? - Edited By PsychoFarmer On Sat 3rd, Apr 2004 @ 10:58:05pm -- ___________________________
|
||
Apr 4 2004 Anchor | ||
Just have it while through results while x is below or equal to 5. Then in the while loop add one to xx ($x++) and if($x > 6) echo </-br-/>; reset $x -- Why wont it save me? |
||
|
Apr 4 2004 Anchor | |
so add the while loop inside of the current while loop? -- ___________________________
|
||
Apr 4 2004 Anchor | ||
*looks at post* not what I said. Something roughly like this
-- Why wont it save me? |
||
|
Apr 5 2004 Anchor | |
but i want more than 5 there... i just want it formatted in blocks of 5 im thinking that ill just have it do an if statement how would i have to tell if x is a multiple of 5 though? -- ___________________________
|
||
Apr 5 2004 Anchor | ||
Thats why $x is reset. Notice; if x is 5 Also you need to run this while in your main while for results you know. -- Why wont it save me? |
||
|
Apr 5 2004 Anchor | |
-- ___________________________
|
||
Apr 5 2004 Anchor | ||
Why the question mark, you answered your question. -- Why wont it save me? |
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.