You are here: Re: Populating <options> tag with SQL data? « PHP Programming Language « IT news, forums, messages
Re: Populating <options> tag with SQL data?

Posted by cresh on 05/03/07 15:08

On May 3, 9:51 am, ZeldorBlat <zeldorb...@gmail.com> wrote:
> Difficult to say. You haven't told us anything about the database
> (like the tables you are using or even the server software). You
> haven't told us what you've tried or done so far, and you haven't
> shown us any code you've written. We can't help you without some
> additional details


I am using PHP and HTML to make the form. The server software is MySQL
database. I can pull information from the database fine, I just don't
know how to put the information into an HTML form as options in a drop
down box.

For example:

The table contains five records: OPTION1, OPTION2, OPTION3, OPTION4,
OPTION5.

I can pull the data from the table using an array, no problems there.
I can display the data, etc., just can't figure out how to put the
data into a form <option> tag.

Maybe something like this:
<form action="process.php" method="post">
<p>Select An Option:
<select name="program" style="color:#FF0000">
<option value="<?echo $program[ ] ; ?>" selected="selected"><?echo
$program[ ] ; ?></option>
<option value="<?echo $program[ ] ; ?>"><?echo $program[ ] ; ?></
option>
<option value="<?echo $program[ ] ; ?>"><?echo $program[ ] ; ?></
option>
<option value="<?echo $program[ ] ; ?>"><?echo $program[ ] ; ?></
option>
<option value="<?echo $program[ ] ; ?>"><?echo $program[ ] ; ?></
option>
</select>

Do you see what I'm trying to do now? I'm not sure if I'm making
myself clear enough. $program[ ] is the variable to hold the
information pulled from the database table.

Thanks again,

Cresh

 

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

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