Re: Double results??

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

 



In mail.php.general, Dan Shirah <mrsquash2@xxxxxxxxx> wrote:
>  $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

I don't know anything about the Informix functions, but in other database
types fetch_row can return "doubly indexed" entries.   e.g.
array(
 0 => 'John',
 'name' => 'John',
)

I would suggest you use var_dump() or var_export() to get a better idea of
what is in $name - you might find if this is the case that your code
is not necessarily wrong because you are getting the right number of rows.

Note it is hard to tell from your code - because your code would run
print_r() for every loop - but that isn't what your suggested output is.

Regards,
PG

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


[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