Try this...
Modify tablename() function
public function tablename($nam,$num)
{
$this->table=mysql_query("INSERT INTO employee(name,number) VALUES ('$nam','$num')");
}
Get values and call tablename() function
$name=new Database;
$name->connection();
if(!($name->con))
{
echo "'Error: ' . mysql_error()";
}
$name->databaseconnection();
$nam=$_POST[name];
$num=$_POST[number];
$name->tablename($nam,$num);
echo "thanks for taking the survey";