First of all, you should be SELECTing columns, not tables and FROM tables not a database. In other words:
<?php
mysql_select_db('people_db');
$query = "SELECT * FROM people WHERE name='$_POST[name]'";
$do_it = mysql_query($query);
?>
So, to answer your question about knowing the id beforehand, since you're displaying names on a page and drawing those names from the database, you might as well take the id from the database at the same time. You can print the name out on the HTML page as a link, but you should use the id in the link instead of the name.
Example:
<a href="moreinfo.php?id=2">NoobNewbie</a>
That's if the id was 2 in the database for the name "NoobNewbie." Then, when the link is clicked, the following code is executed:
moreinfo.php<?php
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
$do_it = mysql_query("SELECT age FROM people WHERE id=$_GET[id]");
if ($do_it && mysql_num_rows($do_it)) echo mysql_result($do_it,0);
}
?>
(mysql_result() is usually only good when returning one expected result. Otherwise use mysql_fetch_row()/_assoc().) The above code will query the database for a user by the id in $_GET['id'] and print the age, if a result is found.