what is wrong with this statement? The $ session is defined on the page.
$session;
if($row_test['P_ID'] = $session){echo'show value';} elseif($row_test['P_ID'] <> $session){echo'do not value';}
The problem lies in the operator you're using. You're assing a value - not checking one.
Take a look at the [man]operators.comparison[/man] page - you've made a common '=' mistake!