# "The two row problem"

**URL:** <https://forum.kirupa.com/t/the-two-row-problem/225191>\
**Category:** programming\
**Created:** [May 9, 2007, 3:37pm UTC](https://forum.kirupa.com/t/the-two-row-problem/225191 "2007-05-09T15:37:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunetics](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@lunetics](https://forum.kirupa.com/u/lunetics)\
**Post date:** [May 9, 2007, 3:37pm UTC](https://forum.kirupa.com/t/the-two-row-problem/225191/1 "2007-05-09T15:37:33Z")

</div>

**Hi!**  
I have a system for a dog competition and this is how it (should) works. When I add a new dog to the system it also creates two judge protocols. This two protocol has the same dog-ID in the database but is saved as two new rows. The both protocol must be passed by two different judges. Each protocol has an status column in the database. When a judge passes a protocol it will get the status = 1. When it´s done it will automatically showed on the secretary page. The problem is that I don´t want to show the protocol summary from the two judges until both of them has passes their protocol.

If the database look likes this I don´t want to show the protocol summary for dog\_id = 12:

```auto

|----------------|
| dog_id | status|
|----------------|
| 12 | 1 |
|----------------|
| 12 | 0 |
|----------------|

```

But if the database look likes this I will show the protocol summary for dog\_id = 12:

```auto

|----------------|
| dog_id | status|
|----------------|
| 12 | 1 |
|----------------|
| 12 | 1 |
|----------------|

```

dog\_id only returns twice in the table because there are just two protocol. Hope my description is not that confused. :look:

Summary: I only want to show the summary list where both protocol - with the same dog\_id - has status = 1.
