I have table “pages” and have 4 positions.
My question is how I am going to show value of “5” on select option instead of showing all positions from 1 – 5.
Image Example:
Instead of

It should only show:

function get_all_arjay_pages_desc(){
$query = "SELECT *
FROM pages
ORDER BY position DESC";
$result = mysql_query($query);
validate_query($result);
return $result;
}
echo "<select name='position' id=''>";
$get_all_page = get_all_arjay_pages_desc();
$page_counts = mysql_num_rows($get_all_page);
for($count=1; $count <= $page_counts + 1;$count++){
echo "<option value='{$count}'>{$count}</option>";
}
echo "</select>";
Thanks in advance. 🙂
Check for last value of
$countand add selected