Hey that was spam. Anyway tell us what you want to achieve.
Looks like you are trying some wrong way.
Still, if you want to sore the name in database and retrieve it from database...here is an example...
You need to have a table. So for eg. assume your database name is test, table name is tbltest, and the field you want to store the name is simply name.
PHP:
<?php
//Get the value from form and store it in a variable
$name = $_POST['name'];
//Connect MySQL Database
$link = mysql_connect("localhost", "root", "root") or die(mysql_error());
mysql_select_db("test");
//Insert name into MySQL Database
$query = "INSERT INTO tbltest(name) VALUES('" . $name . "')";
mysql_query($query, $link) or die(mysql_error());
//Retrieve name from MySQL Database
$query = "SELECT * FROM tbltest WHERE name =" . $name;
$result = mysql_query($query, $link) or die(mysql_error());
$row = mysql_fetch_row($result);
echo $row['name'];
//Close the Connection
mysql_close($link);
?>
Now see, while fetching the value, you can fetch the whole table using SELECT * FROM tbltest. But that would fetch all the names you have inserted, which I'm sure you don't want. And the example that I showed you, the where is clause is simply vogus, but I didn't find any other way out to show you. So you'd need a where clause, which depends on what you actually want to implement.
Even the avobe example looks much vogus to me. So tell us what you want to achieve, we can suggest you better code.
This is just an example, in real life we should implement, if $link > 1, to verify whether the database have been connected or not, though die() ensures that here, then mysql_num_rows($result) > 1, to verify whether any data has been fetched or not before populating that data, to avoid errors, etc.