Hi Guys!
I want to know how to limit the no of records to be shown in dropdown list from mysql.Below is my code. I just want to list 4 records from colum name 'department_name'. The colum has 11 records in total.
<select class="ac" name="area" >
<?php
$qry = mysql_query("SELECT department_id, department_name FROM departments");
while($db = mysql_fetch_array($qry)){
?>
<option value="<?=$db['department_id']?>">
<?=$db['department_name']?>
</option>
<?php
}
?>
</select>
Plus want to know how to pull out the already stored vlaue for yes/no dropdown list and checkbox. I want to know php syntax. I can insert the values into database from my form but for edit page, I want the already stored value to be shown to users who intend to modify a user details.
Thanks