Hi,
you have to create html form and then pass the data from the to your query,
It will look similar to this:
HTML FORM
<form action="" method="POST">
<select name="field">
Choose a field:
<option>field1</option>
<option>field2</option>
Number of records:
<input type="text" name="number" />
<input type="submit" name="ok" value="show" />
</form>
PHP code:
if(isset($_POST['ok'])){
$field=$_POST['field'];
$num=$_POST['number'];
$query=mysql_query("SELECT ".$field." FROM `yourDB` limit 0,".$num." ");
while($row=mysql_fetch_array($query)){
echo'<p>'.$row.'</p>';
}
It is not checking the any error or something, if you want more functional script write to PM.