how to insert foreign key value not id through form in php
my one table (user) contains attributes user_id|user_name|address|phone_no|designation_id | where designation_id is a foreign key and my 2nd table (designation) contains attributes designation_id|designation_name| i want to insert new entries through form and want to enter foreign key(designation_id) value not id so that this value stores in designation table.My code for insert new data is this but it only takes designation_id not value.
if(isset($_POST['user_name']))
{
$user_name=$_POST['user_name'];
$address=$_POST['address'];
$phone_no=$_POST['phone_no'];
$designation_id=$_POST['designation_id'];
if(mysql_query("insert into user(user_id,user_name,address,phone_no,designation_id) values ('','$user_name','$address','$phone_no','$designation_id')"))
echo "successful insertion!";
else
echo"please try again";
}
$res=mysql_query("select * from user");
what should i do so that my insert foreign key value not id,it save in designation table.
if(isset($_POST['user_name']))
{
$user_name=$_POST['user_name'];
$address=$_POST['address'];
$phone_no=$_POST['phone_no'];
$designation_id=$_POST['designation_id'];
if(mysql_query("insert into user(user_id,user_name,address,phone_no,designation_id) values ('','$user_name','$address','$phone_no','$designation_id')"))
echo "successful insertion!";
else
echo"please try again";
}
$res=mysql_query("select * from user");
what should i do so that my insert foreign key value not id,it save in designation table.