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/68 11:47

rich wrote:
> Still getting the same thing. There must be a bug. maybe it has
> something to do with it being part of a table?

hmmmz, atih with pf_fetch_assoc you're sure there is only the associative
array, so that would take care of doubles on that side (and uses less space,
is about the same speed, so always a good idea).

What is the exact reason you assign it to the variable $eachunit and
$eachid? The only thing I can think of is that somehow, there is a second
loop through the code.

PHP doesn't care you echo it in a select box...... What does yout HTML
output look like?

What about trying:
printf('option value="%s">%s</option>', $myunits['unitid'],
$myunits['unitname']);

Else, for debugging purposes:
$check = array();
while($myunits=pg_fetch_assoc($qunit)){
$check[] = $myunits;
}
print_r($check);

What does that tell you?

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

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