Ok Nav it is now working correctly....
But the echo statements after the query
echo "name from page=".$name_n;
is not working!!!!! There is no error messages displaying.. but there is nothing printing other than the query
Whats t1.personal_name ? Is t1 a table name ? If yes, then I would suggest you to use an alias for that column. For example,
$query="select t1.name as name, t2.dept_no as dept from emp t1, dept t2 where t1.dept_id=t2.dept_id";