$sql = "SELECT * FROM $table WHERE id=$id";
$result = mysql_query($sql) or die(mysql_error());
// Dohh - it's this row below that's your problem, as soon as you enter the while loop below this row is ditched or [see below]
$myrow = mysql_fetch_array($result);
while ($myrow = mysql_fetch_array($result)) {
printf("%s %s %s <br />", $myrow2["firstname"], $myrow2["lastname"],$myrow2["title"]);
}
This should work
$sql = "SELECT * FROM $table WHERE id=$id";
$result = mysql_query($sql) or die(mysql_error());
if(!$result) {blahhh blahhh... no result, etc}
do
{
printf("%s %s %s <br />", $myrow2["firstname"], $myrow2["lastname"],$myrow2["title"]);
}
while ($myrow = mysql_fetch_array($result));