RE: [PHP-DB] Repetitive Result

2005-09-21 Thread Bastien Koert
depends on your query, some joins might make for duplicate results...show 
your code


bastien



From: [EMAIL PROTECTED]
To: php-db@lists.php.net php-db@lists.php.net
Subject: [PHP-DB] Repetitive Result
Date: Wed, 21 Sep 2005 16:02:48 -0400

I have a table created from two mysql tables which shows all Members of  
Congress with related data.  The Representative's name is pulled from one  
sql table and the data from another sql table.  When the php table comes  
up on the web page, the name of the Representative for Maryland's 2nd  
district appears for the 3rd through the eighth districts as well:


Representative  State   District

Gilchrest   MD  1
Ruppersberger   MD  2
Ruppersberger   MD  3
Ruppersberger   MD  4
Ruppersberger   MD  5
Ruppersberger   MD  6
Ruppersberger   MD  7
Ruppersberger   MD  8

The rest of the 435 names are correct in the table on the web page.  The  
data for MD districts 2-8 are correct.  The correct names are shown in the  
sql table on the server for MD districts 2-8 and there are not duplicate  
entries for Ruppersberger.  I tried changing the spelling of Ruppersberger  
in the sql table on the server and it changed for each of the results for  
Ruppersberger (districts 2-8) in the web page table.


Why am I getting the repetition shown above?

Ken

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Repetitive Result

2005-09-21 Thread kc68

Here's the query (actually pulled from 3 sql tables; no joins):

select

109fh4.rep,
veteransdata04.state,
veteransdata04.cd,
109fh4.party,
1091vote224.vote1091224,
veteransdata04.vetpop,
veteransdata04.totalexpend*1000,
veteransdata04.totalpatients,
veteransdata04.medexpend*1000,
veteransdata04.totalexpend*1000/veteransdata04.totalpatients

from veteransdata04, 109fh4, 1091vote224

where

veteransdata04.ident = 109fh4.ident and
veteransdata04.ident = 1091vote224.ident and
109fh4.ident = 1091vote224.ident

order by $sort_field $sort_order;

$data_set = mysql_query($get_data_query, $dbh);

*
On Wed, 21 Sep 2005 16:11:32 -0400, Bastien Koert [EMAIL PROTECTED]  
wrote:


depends on your query, some joins might make for duplicate  
results...show your code


bastien



From: [EMAIL PROTECTED]
To: php-db@lists.php.net php-db@lists.php.net
Subject: [PHP-DB] Repetitive Result
Date: Wed, 21 Sep 2005 16:02:48 -0400

I have a table created from two mysql tables which shows all Members  
of  Congress with related data.  The Representative's name is pulled  
from one  sql table and the data from another sql table.  When the php  
table comes  up on the web page, the name of the Representative for  
Maryland's 2nd  district appears for the 3rd through the eighth  
districts as well:


Representative  State   District

Gilchrest   MD  1
Ruppersberger   MD  2
Ruppersberger   MD  3
Ruppersberger   MD  4
Ruppersberger   MD  5
Ruppersberger   MD  6
Ruppersberger   MD  7
Ruppersberger   MD  8

The rest of the 435 names are correct in the table on the web page.   
The  data for MD districts 2-8 are correct.  The correct names are  
shown in the  sql table on the server for MD districts 2-8 and there  
are not duplicate  entries for Ruppersberger.  I tried changing the  
spelling of Ruppersberger  in the sql table on the server and it  
changed for each of the results for  Ruppersberger (districts 2-8) in  
the web page table.


Why am I getting the repetition shown above?

Ken

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Repetitive Result

2005-09-21 Thread Bastien Koert

um, that is a join, just uses the older syntax.

try selecting with the distinct clause

select
distinct(109fh4.rep),
veteransdata04.state


bastien




From: [EMAIL PROTECTED]
To: php-db@lists.php.net php-db@lists.php.net
Subject: Re: [PHP-DB] Repetitive Result
Date: Wed, 21 Sep 2005 16:17:53 -0400

Here's the query (actually pulled from 3 sql tables; no joins):

select

109fh4.rep,
veteransdata04.state,
veteransdata04.cd,
109fh4.party,
1091vote224.vote1091224,
veteransdata04.vetpop,
veteransdata04.totalexpend*1000,
veteransdata04.totalpatients,
veteransdata04.medexpend*1000,
veteransdata04.totalexpend*1000/veteransdata04.totalpatients

from veteransdata04, 109fh4, 1091vote224

where

veteransdata04.ident = 109fh4.ident and
veteransdata04.ident = 1091vote224.ident and
109fh4.ident = 1091vote224.ident

order by $sort_field $sort_order;

$data_set = mysql_query($get_data_query, $dbh);

*
On Wed, 21 Sep 2005 16:11:32 -0400, Bastien Koert [EMAIL PROTECTED]  
wrote:


depends on your query, some joins might make for duplicate  results...show 
your code


bastien



From: [EMAIL PROTECTED]
To: php-db@lists.php.net php-db@lists.php.net
Subject: [PHP-DB] Repetitive Result
Date: Wed, 21 Sep 2005 16:02:48 -0400

I have a table created from two mysql tables which shows all Members  of  
Congress with related data.  The Representative's name is pulled  from 
one  sql table and the data from another sql table.  When the php  table 
comes  up on the web page, the name of the Representative for  Maryland's 
2nd  district appears for the 3rd through the eighth  districts as well:


Representative  State   District

Gilchrest   MD  1
Ruppersberger   MD  2
Ruppersberger   MD  3
Ruppersberger   MD  4
Ruppersberger   MD  5
Ruppersberger   MD  6
Ruppersberger   MD  7
Ruppersberger   MD  8

The rest of the 435 names are correct in the table on the web page.   The 
 data for MD districts 2-8 are correct.  The correct names are  shown in 
the  sql table on the server for MD districts 2-8 and there  are not 
duplicate  entries for Ruppersberger.  I tried changing the  spelling of 
Ruppersberger  in the sql table on the server and it  changed for each of 
the results for  Ruppersberger (districts 2-8) in  the web page table.


Why am I getting the repetition shown above?

Ken

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Repetitive Result

2005-09-21 Thread kc68
That didn't do it.  I tried with parentheses around the 109fh4.rep and  
without the parentheses.  The really curious thing is that the repetition  
only happens within Maryland and starts with the second Maryland entry.   
The next state is Maine (alphabetical by the abbreviation ME) and there is  
no repetition.



On Wed, 21 Sep 2005 16:36:59 -0400, Bastien Koert [EMAIL PROTECTED]  
wrote:



um, that is a join, just uses the older syntax.

try selecting with the distinct clause

select
distinct(109fh4.rep),
veteransdata04.state


bastien




From: [EMAIL PROTECTED]
To: php-db@lists.php.net php-db@lists.php.net
Subject: Re: [PHP-DB] Repetitive Result
Date: Wed, 21 Sep 2005 16:17:53 -0400

Here's the query (actually pulled from 3 sql tables; no joins):

select

109fh4.rep,
veteransdata04.state,
veteransdata04.cd,
109fh4.party,
1091vote224.vote1091224,
veteransdata04.vetpop,
veteransdata04.totalexpend*1000,
veteransdata04.totalpatients,
veteransdata04.medexpend*1000,
veteransdata04.totalexpend*1000/veteransdata04.totalpatients

from veteransdata04, 109fh4, 1091vote224

where

veteransdata04.ident = 109fh4.ident and
veteransdata04.ident = 1091vote224.ident and
109fh4.ident = 1091vote224.ident

order by $sort_field $sort_order;

$data_set = mysql_query($get_data_query, $dbh);

*
On Wed, 21 Sep 2005 16:11:32 -0400, Bastien Koert  
[EMAIL PROTECTED]  wrote:


depends on your query, some joins might make for duplicate   
results...show your code


bastien



From: [EMAIL PROTECTED]
To: php-db@lists.php.net php-db@lists.php.net
Subject: [PHP-DB] Repetitive Result
Date: Wed, 21 Sep 2005 16:02:48 -0400

I have a table created from two mysql tables which shows all Members   
of  Congress with related data.  The Representative's name is pulled   
from one  sql table and the data from another sql table.  When the  
php  table comes  up on the web page, the name of the Representative  
for  Maryland's 2nd  district appears for the 3rd through the eighth   
districts as well:


Representative  State   District

Gilchrest   MD  1
Ruppersberger   MD  2
Ruppersberger   MD  3
Ruppersberger   MD  4
Ruppersberger   MD  5
Ruppersberger   MD  6
Ruppersberger   MD  7
Ruppersberger   MD  8

The rest of the 435 names are correct in the table on the web page.
The  data for MD districts 2-8 are correct.  The correct names are   
shown in the  sql table on the server for MD districts 2-8 and there   
are not duplicate  entries for Ruppersberger.  I tried changing the   
spelling of Ruppersberger  in the sql table on the server and it   
changed for each of the results for  Ruppersberger (districts 2-8)  
in  the web page table.


Why am I getting the repetition shown above?

Ken

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php