| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2005-03-31 16:13 UTC] php-bugs at lists dot php dot net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 12:00:01 2025 UTC | 
Please see attched PHP script sample. When we try to get how many records have been already registered from certain SQL table, usually we can get the correct result except if no record has been registered yet. In that case, pg_NumRows returns 1 instead of 0. I would like you to investigate this problem ASAP. // create SQL script $sql = "select dept_cd, sect_cd, employee_id from employee; $id = pg_Exec( $con, $sql ); if ( !$id ) { echo "SQL cannot be executed!!" ); exit; } // Get the number of rows $num=pg_NumRows( $id ) ; if ( !$num ) { echo "No record is registered!!" ); exit; } else { echo( $num ); }