<html>
<head></head>
<body>
<?php
$id=$_GET['id'];
$hostname = "localhost";
$username = "jesus";
$password = "jesus";
$dbid = "jesus_jesus";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");
$result=mysql_query("select * from jobs where owns='$id'");
while($myrow = mysql_fetch_array($result))
{
print "<option value='$myrow[0]' selected>$myrow[1]</option>";
}
?>
</body>
</html>
In this code i need first value selected default.i execute this code my last database value selected default.is any database solution to find the first position.so i can use if loof.
something like this.
while($myrow = mysql_fetch_array($result))
{
if(myrow[0] == first)
print "<option value='$myrow[0]' selected>$myrow[1]</option>";
else
print "<option value='$myrow[0]'>$myrow[1]</option>";
}