$query = "INSERT INTO contacts('id', 'con_name', 'con_phone', 'con_email')
VALUES('$temp_user_id','$name,'$phone','$email') WHERE id='$temp_user_id'";
try
$query = "INSERT INTO contacts(id, con_name,con_phone, con_email)
VALUES('$temp_user_id','$name,'$phone','$email') WHERE id='$temp_user_id'";
I also suggest adding
or die(mysql_error()) to mysql_query($query, $link);
so mysql_query($query, $link)or die(mysql_error());
Will help in future if you ever get any errors with it.