Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    May 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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++;

    }

  • #4
    New Coder
    Join Date
    May 2004
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you! I have been looking for that forever.

  • #5
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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

  • #6
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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."

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    Depends on the time of year
    Posts
    478
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #8
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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

  • #9
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by krycek; 06-02-2004 at 01:13 AM.
    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."

  • #10
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Good job. You've completely derailed this thread.

    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.

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •