You are here: Re: How can I get just one row from selected column? « PHP SQL « IT news, forums, messages
Re: How can I get just one row from selected column?

Posted by Jim Michaels on 10/03/78 11:39

"Leszek" <leszekt80@poczta.onet.pl> wrote in message
news:dp0v53$b4r$1@news.onet.pl...
> Hi.
> How can I get just one row from selected column and put it into html
> dropdown list
> I tried like this:
>
> function pobierz_wszystko($tabela,$kolumna)

you are referencing the array wrong. it should be $wiersz[$kolumna] when you
want to extract data from the column.
echo "<option value=$wiersz[$kolumna]>$wiersz[$kolumna]</option> <br
/>";


> {
> $zapytanie="SELECT $kolumna FROM $tabela";
> $wynik=mysql_query($zapytanie);
> while($wiersz=mysql_fetch_array($wynik,MYSQL_ASSOC))
> {
> echo "<option value=$wiersz>$wiersz</option> <br />";
> }
> }
>
> <select name="$hname">
> <option value="*" selected >All</option>
> <?php
> pobierz_wszystko('hotel','hotel_nazwa');
> ?>
> </select>
>
>
> But it doesn't work properly because I'm getting a dropdown list with
> All,and Array,Array,Array,Array,Array
> Instead of Array I'd like to have a value from a row.
>
> Is it because I'm using mysql_fetch_array($wynik,MYSQL_ASSOC)?
> or maybe the query is wrong?
>
> Thanks
> Leszek
>
>

 

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

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