Hi.
How can I get just one row from selected column and put it into html
dropdown list
I tried like this:
function pobierz_wszystk o($tabela,$kolu mna)
{
$zapytanie="SEL ECT $kolumna FROM $tabela";
$wynik=mysql_qu ery($zapytanie) ;
while($wiersz=m ysql_fetch_arra y($wynik,MYSQL_ ASSOC))
{
echo "<option value=$wiersz>$ wiersz</option> <br />";
}
}
<select name="$hname">
<option value="*" selected >All</option>
<?php
pobierz_wszystk o('hotel','hote l_nazwa');
?>
</select>
But it doesn't work properly because I'm getting a dropdown list with
All,and Array,Array,Arr ay,Array,Array
Instead of Array I'd like to have a value from a row.
Is it because I'm using mysql_fetch_arr ay($wynik,MYSQL _ASSOC)?
or maybe the query is wrong?
Thanks
Leszek
How can I get just one row from selected column and put it into html
dropdown list
I tried like this:
function pobierz_wszystk o($tabela,$kolu mna)
{
$zapytanie="SEL ECT $kolumna FROM $tabela";
$wynik=mysql_qu ery($zapytanie) ;
while($wiersz=m ysql_fetch_arra y($wynik,MYSQL_ ASSOC))
{
echo "<option value=$wiersz>$ wiersz</option> <br />";
}
}
<select name="$hname">
<option value="*" selected >All</option>
<?php
pobierz_wszystk o('hotel','hote l_nazwa');
?>
</select>
But it doesn't work properly because I'm getting a dropdown list with
All,and Array,Array,Arr ay,Array,Array
Instead of Array I'd like to have a value from a row.
Is it because I'm using mysql_fetch_arr ay($wynik,MYSQL _ASSOC)?
or maybe the query is wrong?
Thanks
Leszek
Comment