Re: Double results??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 25, 2008 at 4:55 PM, Dan Shirah <mrsquash2@xxxxxxxxx> wrote:

> Hello all,
>
> I am running the following query...I get the results I want, but for some
> reason I am getting every valid result twice?
>
> Any ideas?
>
>  $name_query = "SELECT caa44240002, caa44240003, caa44240004, caa442400018
>        FROM caa44240
>        WHERE caa442400018 = '$case_id'";
>  if ($case_category == "CJ") {
>   $name_query.="AND caa44240002 = 'C'
>        AND caa44240003 = '1'";
>  }
>  if ($case_category == "CF" || "MM" || "CT" || "TR" || "MO" || "IN" ||
> "CO") {
>   $name_query.="AND caa44240002 = 'D'
>        AND caa44240003 = '1'";
>  }
>  $name_result = ifx_query ($name_query, $connect_id);
>  while ($name = ifx_fetch_row($name_result)) {
>   $party_name = TRIM($name['caa44240004']);
>   print_r($name);
>  }
>
> print_r($name) will return:
> John
> John
> Mary
> Mary
> Cindy
> Cindy
>

maybe a distinct in the field selection

select DISTINCT blah from blah where...

-- 

Bastien

Cat, the other other white meat

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux