Please tell me, How I can handle the condition when a resultset does no return a value ? thanks.
I guess you mean the condition where a resultset returns zero rows?
Look at the postgres section in the php manual. http://www.php.net/manual/en/function.pg-numrows.php
you can use pg_numrows to see how many rows came back. If pg_numrows returns 0, then you didn't get any results.