hi list. this is my script: $query7="select provinceid from province where province like '$tablename1';"; $result7=pg_exec($conn,$query7); if(!$result7){ . . .} else { . . . } my problem is when the value of the variable $tablename1 is not on the table province, it doesn't go to the if statements. what am i doing wrong? thanks!