Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-01-2004, 02:05 AM   PM User | #1
Darren06
New Coder

 
Join Date: May 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Darren06 is an unknown quantity at this point
Displaying Results

I have a problem where I want to display a table row (<tr>) tag every three results mysql puts out but do not know what the function is. Can anyone help?
Darren06 is offline  
Old 06-01-2004, 02:56 AM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
There is no function to do this. Doesn't really require a function anyways. It's just a matter of how to write your loops to do this. Post what code you have so far.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline  
Old 06-01-2004, 02:58 AM   PM User | #3
duniyadnd
Regular Coder

 
Join Date: Jun 2002
Location: Depends on the time of year
Posts: 478
Thanks: 0
Thanked 0 Times in 0 Posts
duniyadnd is an unknown quantity at this point
Quote:
Originally Posted by Darren06
I have a problem where I want to display a table row (<tr>) tag every three results mysql puts out but do not know what the function is. Can anyone help?
$i = 0;
while ($i < $limit) {

if ($i % 3 == 0) {

echo '<tr>';

}

// extra stuff

if ($i % 3 == 0) {

echo '</tr>';

}

$i++;

}
__________________
Ithium | FootyMania.com
duniyadnd is offline  
Old 06-01-2004, 04:37 AM   PM User | #4
Darren06
New Coder

 
Join Date: May 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Darren06 is an unknown quantity at this point
Thank you! I have been looking for that forever.
Darren06 is offline  
Old 06-01-2004, 04:43 PM   PM User | #5
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Quote:
Originally Posted by duniyadnd
$i = 0;
while ($i < $limit) {

if ($i % 3 == 0) {

echo '<tr>';

}

// extra stuff

if ($i % 3 == 0) {

echo '</tr>';

}

$i++;

}
That's kind of a convoluted way of doing it. Also where is $limit being set at?
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline  
Old 06-01-2004, 06:41 PM   PM User | #6
krycek
Regular Coder

 
Join Date: Nov 2002
Location: Bristol, UK
Posts: 932
Thanks: 0
Thanked 0 Times in 0 Posts
krycek is an unknown quantity at this point
Quote:
Originally Posted by Spookster
That's kind of a convoluted way of doing it. Also where is $limit being set at?
hmmmmm.

I don't think that's the point. Duniyadnd answered the question helpfully, and provided code that helped the person in need. I don't think he had to supply a fully-functioning module. He just provided what was needed, and the person was happy.

On the other hand, it strikes me that you, Spookster, have yet to contribute anything productive to this thread. You have not said anything helpful, and you have not answered the original question. AND you have unfairly criticised Duniyadnd.

For as long as I have been a member here, CF has been about helping people. Ask yourself who fitted that description more, and then chew on the answer for a while. And before you point out the many, many times you *have* helped people here (I'm very much aware of them) just stop, and think about what I'm trying to say.

Perhaps then you will post a less 'convoluted' method of acheiving the desired result, which may lead to happy discussion etc. Or not, seeing as the questioner is already satisfied.
__________________
ithium | SOAPI | SDP | PTPScript manual
"ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."
krycek is offline  
Old 06-01-2004, 06:44 PM   PM User | #7
duniyadnd
Regular Coder

 
Join Date: Jun 2002
Location: Depends on the time of year
Posts: 478
Thanks: 0
Thanked 0 Times in 0 Posts
duniyadnd is an unknown quantity at this point
Quote:
Originally Posted by Spookster
That's kind of a convoluted way of doing it. Also where is $limit being set at?
You're kidding me right?
__________________
Ithium | FootyMania.com
duniyadnd is offline  
Old 06-01-2004, 11:40 PM   PM User | #8
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Quote:
Originally Posted by krycek
hmmmmm.

I don't think that's the point. Duniyadnd answered the question helpfully, and provided code that helped the person in need. I don't think he had to supply a fully-functioning module. He just provided what was needed, and the person was happy.

On the other hand, it strikes me that you, Spookster, have yet to contribute anything productive to this thread. You have not said anything helpful, and you have not answered the original question. AND you have unfairly criticised Duniyadnd.

For as long as I have been a member here, CF has been about helping people. Ask yourself who fitted that description more, and then chew on the answer for a while. And before you point out the many, many times you *have* helped people here (I'm very much aware of them) just stop, and think about what I'm trying to say.

Perhaps then you will post a less 'convoluted' method of acheiving the desired result, which may lead to happy discussion etc. Or not, seeing as the questioner is already satisfied.
First of all if you have a problem with me then you could have just as easily sent me a PM about it. In my opinion you are now in violation of our rules of being hostile and confrontational to other members. I would suggest you review our rules before posting any more here at codingforums. Consider this your warning. It seems to me that by posting your comments to me you did not contribute anything productive to this thread as you have accused me of doing.

Second of all I was in the process of providing help to this member when duniyadnd jumped into the conversation. But maybe you missed that part.

Thirdly I was not criticizing his post. I was stating a fact and then asked a question. What he posted was not the best way to code that and if he hadn't of jumped in then I would have provided the less convoluted way of coding it.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline  
Old 06-02-2004, 12:07 AM   PM User | #9
krycek
Regular Coder

 
Join Date: Nov 2002
Location: Bristol, UK
Posts: 932
Thanks: 0
Thanked 0 Times in 0 Posts
krycek is an unknown quantity at this point
Quote:
Originally Posted by Spookster
First of all if you have a problem with me then you could have just as easily sent me a PM about it. In my opinion you are now in violation of our rules of being hostile and confrontational to other members.
I have been polite, and I made my point clearly, and in a non-confrontational way.


Quote:
Originally Posted by Spookster
I would suggest you review our rules before posting any more here at codingforums. Consider this your warning.
I would do, if it were your place to warn me. I have been a member here long enough to know the rules extemely well, and I have not broken, or even bent, any of them. I am well-respected here, and I have provided help and services to an awful lot of people on these boards. If you don't like me pointing out that you criticised someone unfairly, that's fine. However, I don't think flaming me with an impotent warning is polite, helpful, or constructive. In fact, I would call it hostile.


Quote:
Originally Posted by Spookster
It seems to me that by posting your comments to me you did not contribute anything productive to this thread as you have accused me of doing.
It would have been productive if you had taken my comments the right way. Let's say it wasn't Duniyadnd, but someone else, a bit newer. What you said could well have put them off helping someone else in future, or put them off posting here at CF. In which case, surely it can be considered productive for you to think about what I was trying to say.


Quote:
Originally Posted by Spookster
Second of all I was in the process of providing help to this member when duniyadnd jumped into the conversation. But maybe you missed that part.
Obviously so... I only read the thread, I have not been aware of any help you were providing outside of it. In which case you have my apologies. But as for Duniyadnd 'jumping in' - what the heck? Are you serious? I don't see your name on the thread as designated respondee, plus you know as well as I do that everyone is free to post advice as they see fit. I don't see anything wrong with what Duniyadnd posted. Rather, it was what the person was looking for. Which is why I posted in the first place - what's your problem? Why criticise him?


Quote:
Originally Posted by Spookster
Thirdly I was not criticizing his post. I was stating a fact and then asked a question. What he posted was not the best way to code that and if he hadn't of jumped in then I would have provided the less convoluted way of coding it.
Hmmmm, once more I apologise if you were not meaning to be critical. But it sure looked that way, and Duniyadnd seemed to think so too, from his response.

I really don't know what your problem is, but you've annoyed both Duniyadnd and myself, needlessly. If you consider his method convoluted, why not post your own method so he can compare it, and learn from it if need be? Or maybe debate the pros and cons of each? Without doing that, it sure sounds like unnecessary criticism.

So, rewind, don't get hot under the collar just because someone like myself tries to point out that something you said may not be perfect (yes, you get things wrong at times you know, just like the rest of us) and instead of (in my opinion) throwing your weight around by giving a 'warning' (which is without cause, substance, or backing) just chill!

Now, how to break the strange tension that seems to have arisen, that I am so unused to here? Hmmm, time for something funny, perhaps...

"I've never had major knee surgery on any other part of my body," -- Winston Bennett, University of Kentucky basketball forward.
__________________
ithium | SOAPI | SDP | PTPScript manual
"ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

Last edited by krycek; 06-02-2004 at 12:13 AM..
krycek is offline  
Old 06-02-2004, 12:14 AM   PM User | #10
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Good job. You've completely derailed this thread.

Quote:
I would do, if it were your place to warn me.
Last time I checked I am the moderator of this forum. So yes it is my place to warn you.

Here refresh your memory of our rules.

Quote:
Penalty for abusing/breaking the above guidelines will result in action taken either by a moderator or admin. Sometimes it's as simple as your post being edited out (which does not always equate to a penalty, rather, just a reminder), other times, you will be contacted and warned. In more severe cases, you will be banned immedately and without notice. However banned, it is permanent.
This thread is now locked.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:35 PM.


Advertisement
Log in to turn off these ads.