Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8972615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:15:29+00:00 2026-06-15T18:15:29+00:00

Simple question I guess, how do I check if the row was grouped in

  • 0

Simple question I guess, how do I check if the row was grouped in a while loop. I want to be able to determine if it was grouped so I can change the text that is echoed if it is grouped but keep the rows that aren’t grouped the same. I hope that this makes sense as I am not sure how else to explain it.

This is the code I have

if($r['type'] == "Wall"){
$offern = $r['aff'];
}else{
$offern = $offn['name'];
}
//  IF GROUPED $r['user_id'] <- It is grouped by `user_id` -> $offern = "Several";

print "<tr>
<td></td>
                <td><a href='lockedf.php?id=".$r['user_id']."'>{$namess['username']}</a></td>
                <td>".$offern."</td>
                <td>{$r['point']} Points</td>
                <td>".date("m/d/Y h:i:s A", $r['date_submitted'])."</td>
                <td><a href='unlock.php?id={$r['id']}' class='ask'><img src='images/unlock.png' alt='' title='' border='0' /></a></td>
                <td><a href='deny.php?id={$r['id']}' class='ask'><img src='images/trash.png' alt='' title='' border='0' /></a></td>
                </tr>";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:15:30+00:00Added an answer on June 15, 2026 at 6:15 pm

    So, if you had data like this:

    `USER_ID`  |  `FavoriteCandy`
    
    1        |   'Snickers'
    1        |   'Butterfinger'
    2        |   'Hershey'
    3        |   'Twix'
    

    And a query like this:

    SELECT USER_ID
    FROM tbl
    GROUP BY USER_ID;
    

    And your goal was to figure out which user (user 1 in this case) might be missing candy because it was grouped on…you could do this:

    SELECT `USER_ID`, COUNT(`FavoriteCandy`)
    FROM tbl
    GROUP BY USER_ID;
    

    Or, limit it to just users who are grouped like this:

    SELECT `USER_ID`
    FROM tbl
    GROUP BY USER_ID
    HAVING COUNT(`FavoriteCandy`) > 1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a simple question i guess.... I have a panel that i can
Simple question I guess, I want to use PHP to write an update to
A fairly simple question for which I have a guess, but I can't find
Hi This is a simple question i guess: My requirement is in the Text
I have a very simple question (I guess!) How can clone method be protected
simple question really (can hazard a guess but just need to make sure), Just
I guess it's a simple question, but how can I replace nil values in
This is a simple question,I guess, but I couldn't figure it out. How do
A little stuck here. I have a simple question I guess. Given the following
I guess this is a simple question. I need to do something like this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.