Changeset 6145
- Timestamp:
- 05/08/12 17:39:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/services/PostgreSQL.php
r6132 r6145 40 40 */ 41 41 42 /**43 *44 * @package Prototype45 * @license http://www.gnu.org/copyleft/gpl.html GPL46 * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)47 * @version 2.448 * @sponsor Caixa Econômica Federal49 * @since Classe disponibilizada na versão 2.450 */51 42 class PostgreSQL implements Service 52 43 { … … 109 100 $rs = pg_query( $this->con, $sql ); 110 101 111 if( is_bool( $rs ) )112 { 113 if ( !$rs )102 switch( pg_num_rows( $rs ) ) 103 { 104 case -1: 114 105 $this->error = pg_last_error ( $this->con ); 115 116 return( $rs ); 117 } 118 119 if( pg_num_rows( $rs ) <= 0 ) 120 return array(); 121 122 $return = array(); 123 124 while( $row = pg_fetch_assoc( $rs ) ) 125 $return[] = $row; 126 127 return( $unique ? $return[0] : $return ); 128 } 106 return( false ); 107 108 case 0: 109 return( pg_affected_rows( $rs ) ? true : array() ); 110 111 default: 112 $return = array(); 113 114 while( $row = pg_fetch_assoc( $rs ) ) 115 $return[] = $row; 116 117 return( $unique ? $return[0] : $return ); 118 } 119 } 120 129 121 130 122 //@DEPRECATED
Note: See TracChangeset
for help on using the changeset viewer.