You are here: Re: I am getting double of all my units in this code. any ideas? « PHP Programming Language « IT news, forums, messages
Re: I am getting double of all my units in this code. any ideas?

Posted by Rik on 11/19/87 11:47

rhdyes@gmail.com wrote:
> $qunit = pg_query("SELECT unitid, unitname FROM li_unit ORDER BY
> unitname");
> while($myunits=pg_fetch_array($qunit)){
> $eachid=$myunits["unitid"];
> $eachunit=$myunits["unitname"];
> }
> Any suggestions?

What happens if you instead use pg_fetch_assoc($qunit)?

pg_fetch_array gives both a numerical and a associative array, maybe that's
the issue. It should not give the error in this code, but maybe you ommited
some seemingly insignificant code. I have no PostgreSQL-server, so I can't
test it.

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация