Page 1 of 1

database to combobox

Posted: Thu Jun 05, 2003 8:46 am
by Brakanjan
Hi

I'm (still) new to php and html and need to do the following:

I have a database and I get values by

while ($R = ibase_fetch_row($Q))
{
echo "$R[0]";
}

Now I want to insert those values in a combobox so the user can select them again. I've tried:

print "<Select>"
while ($R = ibase_fetch_row($Q))
{
print"<Option>";
}
print "</Select>"

As far as I can image 'Print' writes directly to html and you can insert html code directly from php. If 'print' doesn't do the job, what does?

tx

Posted: Thu Jun 05, 2003 8:57 am
by uncoDMX
you could do it this way :

echo '<select>';
while ($R = ibase_fetch_row($Q))
{
echo '<option>', $R[0], '</option>';
}
echo '</select>';

but there are manny things you have to do to make it work right.

read some documentation about forms

Posted: Thu Jun 05, 2003 10:08 am
by Brakanjan
tx for the reply
any recommendations? (about documentation of forms and php)