I have php form which I used to input Members Details of my system into the database. My requirement is to display the last member's 'member id' in a input box. When I try the following code it gives me the 'member id' of all the members in a select box. Please correct my php coding to display only the 'member id' of the last member.
php coding
$dbcon = mysql_connect("localhost","root","root");
$db = mysql_select_db("MemberDB",$con);
$sqlselect = "SELECT MemID FROM Member" ;
$result = mysqli_query($dbcon,$sqlselect);
html coding
<html>
<head>
<title>display the last member id</title>
</head>
<body>
<select id="memid" name="memid1">
<option>Select Member ID</option>";
<?php while($row = mysqli_fetch_array($result)):;?>
<option><?php echo $row[1];?></option>";
<?php endwhile;?>
</select>
</body>
</html>