Subversion Repositories phpLibraryV2

Rev

Rev 42 | Rev 44 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42 Rev 43
Line 335... Line 335...
335
      public function getOneRow( $sql = null ) {
335
      public function getOneRow( $sql = null ) {
336
         if ( isset( $sql ) )
336
         if ( isset( $sql ) )
337
            $this->parameters[ 'query' ] = $sql;
337
            $this->parameters[ 'query' ] = $sql;
338
         $save = $this->parameters[ 'returnType' ];
338
         $save = $this->parameters[ 'returnType' ];
339
         //print "<pre>" . print_r( $this->parameters['query'], true) . '</pre>';
339
         //print "<pre>" . print_r( $this->parameters['query'], true) . '</pre>';
340
         $useAssociativeArray = true;
340
         $this->parameters['returnType'] = 'associative';
341
         $this->run();
341
         $this->run();
342
         $useAssociativeArray = $save;
342
         $this->parameters[ 'returnType' ] = $save;
343
         if ( $this->parameters[ 'rowsAffected' ] == 1 ) {
343
         if ( $this->parameters[ 'rowsAffected' ] == 0 ) {
-
 
344
            return array();
-
 
345
         } elseif ( $this->parameters[ 'rowsAffected' ] == 1 ) {
344
            $this->parameters[ 'returnData' ] = $this->parameters[ 'returnData' ][0];
346
            $this->parameters[ 'returnData' ] = $this->parameters[ 'returnData' ][0];
345
            return $this->parameters[ 'returnData' ];
347
            return $this->parameters[ 'returnData' ];
346
         } else {
348
         } else {
347
            $this->parameters['error'] = "$this->parameters[query] did not return a unique row in getOneRow";
349
            $this->parameters['error'] = "$this->parameters[query] did not return a unique row";
348
            print_r( $this->parameters['query'] ); die;
350
            print "<pre>In Class DBQuery->getOneRow, no unique row in\n" . print_r($this->parameters[query], true) . "\n</pre>"; die;
349
         }
351
         }
350
         return false;
352
         return false;
351
      } // getOneRow
353
      } // getOneRow
352
         
354
         
353
 
355