answersLogoWhite

0

<select name="select1">

<option value="">Please Select...</option>

<?php

$fetchQuery = mysql_query("SELECT * FROM `table`");

while($showOutput = mysql_fetch_object($fetchQuery)){

echo "<option value="{$showOutput->value1}">{$showOutput->value2}</option>";

}

?>

</select>

Using the while function is very useful. If you wish to limit the amount of outputted lines, use LIMIT 10 at the end of the mysql query.

Lewis.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How do you retrieve data stored in the database into the textarea using ASP?

To retrieve data stored in a database and display it in a textarea using ASP, you can use a server-side script to query the database and fetch the data. Then, you can populate the value of the textarea with the retrieved data by echoing it within the textarea tag during the rendering of the page.


Is it possible to call a stored procedure from java script function and populate an aspnet dropdown list HTML control using the value returned by the SP?

No, a stored procedure can not be called from Javascript. A dropdown list however can be populated using a stored procedure.


How do you retrieve the data from database?

To retrieve data rfrom a mysql database you first need to connect to the database using the mysql connection string(mysql_connect) after that, it's just a matter of executing a query of "SELECT `field1`, `field2` FROM `tablename`" Obviously replacing field 1 and 2 with the fields you want to replace and tablename with the table the data is stored


How do you store and retrieve a picture in sybase database?

To store a picture in a Sybase database, you can use a BLOB (Binary Large Object) data type column in a table. You can insert the picture into this column using SQL commands or through an application that interacts with the database. To retrieve the picture, you can query the column where the picture is stored and then display or use the binary data as needed.


What is the purpose of a query in a database?

A database stored different types of information and records. When one wants to retrieve a particular type of information, using queries becomes necessary. One of the common query languages is SQL.


How can I use Oracletoaccess to retrieve data from the database efficiently?

To efficiently retrieve data from a database using Oracle, you can optimize your queries by using indexes, limiting the columns selected, and avoiding unnecessary joins. Additionally, consider using bind variables and tuning the database performance settings for better efficiency.


How do you insert value to a dropdownlist from textbox input php?

Store the textbox input in a database using a html form prefarably. Using a loop get all the textbox input from database and use print/echo to show them in a dropdown.


What is the purpose of the SLQ database?

The SQL database is the most common way to handle the data contained in a database. The type of database most often used (for example using the Microsoft Access software) is a relational database. SQL is the programming language behind a relational database. It provides for ways to organize and retrieve the data stored in the database.


How do you save voice in database access?

I don't know but i need that information about how to store a voice as input for sql server 2005 and retrieve that using current input of voice.., I mean how two compare a already stored voice in database with given new input voice..,


What software tool can be used to create a database add change and delete data in the database sort and retrieve data and create forms and reports using the data in the database?

datebase management system


How do you print using the Rollmaster software?

First you have to retrieve the data from the database by using the 'records view', 'Query' or 'report' menus. Then select print.


What is database searching?

Database searching is the process of querying a database to retrieve specific information. It involves formulating a search query using keywords or filters, and then executing the query to retrieve relevant data. This is commonly used in various fields, such as research, business, and information retrieval.