当前位置: 首页>>代码示例>>PHP>>正文


PHP pg_field_table函数代码示例

本文整理汇总了PHP中pg_field_table函数的典型用法代码示例。如果您正苦于以下问题:PHP pg_field_table函数的具体用法?PHP pg_field_table怎么用?PHP pg_field_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了pg_field_table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: castResult

 public static function castResult($result, array $a, Stub $stub, $isNested)
 {
     $a['num rows'] = pg_num_rows($result);
     $a['status'] = pg_result_status($result);
     if (isset(self::$resultStatus[$a['status']])) {
         $a['status'] = new ConstStub(self::$resultStatus[$a['status']], $a['status']);
     }
     $a['command-completion tag'] = pg_result_status($result, PGSQL_STATUS_STRING);
     if (-1 === $a['num rows']) {
         foreach (self::$diagCodes as $k => $v) {
             $a['error'][$k] = pg_result_error_field($result, $v);
         }
     }
     $a['affected rows'] = pg_affected_rows($result);
     $a['last OID'] = pg_last_oid($result);
     $fields = pg_num_fields($result);
     for ($i = 0; $i < $fields; ++$i) {
         $field = array('name' => pg_field_name($result, $i), 'table' => sprintf('%s (OID: %s)', pg_field_table($result, $i), pg_field_table($result, $i, true)), 'type' => sprintf('%s (OID: %s)', pg_field_type($result, $i), pg_field_type_oid($result, $i)), 'nullable' => (bool) pg_field_is_null($result, $i), 'storage' => pg_field_size($result, $i) . ' bytes', 'display' => pg_field_prtlen($result, $i) . ' chars');
         if (' (OID: )' === $field['table']) {
             $field['table'] = null;
         }
         if ('-1 bytes' === $field['storage']) {
             $field['storage'] = 'variable size';
         } elseif ('1 bytes' === $field['storage']) {
             $field['storage'] = '1 byte';
         }
         if ('1 chars' === $field['display']) {
             $field['display'] = '1 char';
         }
         $a['fields'][] = new EnumStub($field);
     }
     return $a;
 }
开发者ID:JesseDarellMoore,项目名称:CS499,代码行数:33,代码来源:PgSqlCaster.php

示例2: aff_table

function aff_table($res)
{
    echo "<table border=\"1px\" witdh='50%'>";
    echo "<tr>";
    for ($i = 0; $i < pg_num_fields($res); $i++) {
        echo "<th>" . pg_field_name($res, $i) . "</th>";
    }
    echo "</tr>";
    for ($i = 0; $i < pg_num_rows($res); $i++) {
        echo "<tr>";
        for ($j = 0; $j < pg_num_fields($res); $j++) {
            if (pg_field_type($res, $j) == "bytea") {
                $table = pg_field_table($res, 0);
                echo "<td><img width='60%' src='photo.php?table=" . $table . "&id=" . pg_field_name($res, 0) . "&valeur=" . pg_fetch_result($res, $i, 0) . "&champ=" . pg_field_name($res, $j) . "'></td>";
            } else {
                echo "<td>" . pg_fetch_result($res, $i, $j) . "</td>";
            }
        }
        echo "</tr>";
    }
    echo "</table>";
}
开发者ID:laubosslink,项目名称:courses-practical-work,代码行数:22,代码来源:utils.php

示例3: tableInfo

 /**
  * Returns information about a table or a result set
  *
  * NOTE: only supports 'table' and 'flags' if <var>$result</var>
  * is a table name.
  *
  * @param object|string  $result  MDB2_result object from a query or a
  *                                 string containing the name of a table.
  *                                 While this also accepts a query result
  *                                 resource identifier, this behavior is
  *                                 deprecated.
  * @param int            $mode    a valid tableInfo mode
  *
  * @return array  an associative array with the information requested.
  *                 A MDB2_Error object on failure.
  *
  * @see MDB2_Driver_Common::tableInfo()
  */
 function tableInfo($result, $mode = null)
 {
     if (is_string($result)) {
         return parent::tableInfo($result, $mode);
     }
     $db =& $this->getDBInstance();
     if (PEAR::isError($db)) {
         return $db;
     }
     $resource = MDB2::isResultCommon($result) ? $result->getResource() : $result;
     if (!is_resource($resource)) {
         return $db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'Could not generate result resource', __FUNCTION__);
     }
     if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
         if ($db->options['field_case'] == CASE_LOWER) {
             $case_func = 'strtolower';
         } else {
             $case_func = 'strtoupper';
         }
     } else {
         $case_func = 'strval';
     }
     $count = @pg_num_fields($resource);
     $res = array();
     if ($mode) {
         $res['num_fields'] = $count;
     }
     $db->loadModule('Datatype', null, true);
     for ($i = 0; $i < $count; $i++) {
         $res[$i] = array('table' => function_exists('pg_field_table') ? @pg_field_table($resource, $i) : '', 'name' => $case_func(@pg_field_name($resource, $i)), 'type' => @pg_field_type($resource, $i), 'length' => @pg_field_size($resource, $i), 'flags' => '');
         $mdb2type_info = $db->datatype->mapNativeDatatype($res[$i]);
         if (PEAR::isError($mdb2type_info)) {
             return $mdb2type_info;
         }
         $res[$i]['mdb2type'] = $mdb2type_info[0][0];
         if ($mode & MDB2_TABLEINFO_ORDER) {
             $res['order'][$res[$i]['name']] = $i;
         }
         if ($mode & MDB2_TABLEINFO_ORDERTABLE) {
             $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
         }
     }
     return $res;
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:62,代码来源:pgsql.php

示例4: getColumnsMeta

 /**
  * Returns metadata for all columns in a result set.
  *
  * @return array
  */
 public function getColumnsMeta()
 {
     $hasTable = version_compare(PHP_VERSION, '5.2.0', '>=');
     $count = pg_num_fields($this->resultSet);
     $meta = array();
     for ($i = 0; $i < $count; $i++) {
         // items 'name' and 'table' are required
         $meta[] = array('name' => pg_field_name($this->resultSet, $i), 'table' => $hasTable ? pg_field_table($this->resultSet, $i) : NULL, 'type' => pg_field_type($this->resultSet, $i), 'size' => pg_field_size($this->resultSet, $i), 'prtlen' => pg_field_prtlen($this->resultSet, $i));
     }
     return $meta;
 }
开发者ID:laiello,项目名称:webuntucms,代码行数:16,代码来源:postgre.php

示例5: getColumnsMeta

 public function getColumnsMeta()
 {
     $hasTable = version_compare(PHP_VERSION, '5.2.0', '>=');
     $count = pg_num_fields($this->resultSet);
     $res = array();
     for ($i = 0; $i < $count; $i++) {
         $row = array('name' => pg_field_name($this->resultSet, $i), 'table' => $hasTable ? pg_field_table($this->resultSet, $i) : NULL, 'nativetype' => pg_field_type($this->resultSet, $i));
         $row['fullname'] = $row['table'] ? $row['table'] . '.' . $row['name'] : $row['name'];
         $res[] = $row;
     }
     return $res;
 }
开发者ID:umbecr,项目名称:camilaframework,代码行数:12,代码来源:dibi.compact.php

示例6: getFieldInfo

 function getFieldInfo($stack = 0)
 {
     $fields = array();
     $tables = array();
     $num_fields = pg_num_fields($this->result[$stack]);
     for ($i = 0; $i < $num_fields; $i++) {
         $f = new StdClass();
         $f->name = pg_field_name($this->result[$stack], $i);
         $f->table = pg_field_table($this->result[$stack], $i);
         $f->type = pg_field_type($this->result[$stack], $i);
         $f->blob = 0;
         $f->pkey = 0;
         $f->ukey = 0;
         $f->mkey = 0;
         $f->numeric = substr($f->type, 0, 3) == 'int' ? 1 : 0;
         if (!isset($tables[$f->table])) {
             $tables[$f->table] = array();
         }
         $tables[$f->table][] = "'" . $f->name . "'";
         $fields[] = $f;
     }
     $this->getFieldMetaInfo($fields, $tables);
     $this->getFieldConstraints($fields, $tables);
     return $fields;
 }
开发者ID:guohuadeng,项目名称:stampApp,代码行数:25,代码来源:pgsql.php

示例7: FieldTable

 public function FieldTable($fNo, $o = false)
 {
     return pg_field_table($this->ds, $fNo, $o);
 }
开发者ID:raj47i,项目名称:PHP.Fx,代码行数:4,代码来源:pgsqli.php

示例8: _table_name

 protected function _table_name($field)
 {
     return pg_field_table($this->_result, $field);
 }
开发者ID:PHPcomaptibility,项目名称:PHPPDO,代码行数:4,代码来源:pgsql_statement.php

示例9: getResultColumns

 /**
  * Returns metadata for all columns in a result set.
  * @return array
  */
 public function getResultColumns()
 {
     $count = pg_num_fields($this->resultSet);
     $columns = array();
     for ($i = 0; $i < $count; $i++) {
         $row = array('name' => pg_field_name($this->resultSet, $i), 'table' => pg_field_table($this->resultSet, $i), 'nativetype' => pg_field_type($this->resultSet, $i));
         $row['fullname'] = $row['table'] ? $row['table'] . '.' . $row['name'] : $row['name'];
         $columns[] = $row;
     }
     return $columns;
 }
开发者ID:Eflyax,项目名称:KIVWEB,代码行数:15,代码来源:DibiPostgreDriver.php

示例10: pg_fetch_field

 function pg_fetch_field($result, $file_number)
 {
     $pg_to_php = array('bit' => 'bit', 'boolean' => 'bool', 'box' => 'box', 'character' => 'bpchar', 'char' => 'bpchar', 'bytea' => 'bytea', 'cidr' => 'cidr', 'circle' => 'circle', 'date' => 'date', 'daterange' => 'daterange', 'real' => 'float4', 'double precision' => 'float8', 'inet' => 'inet', 'smallint' => 'int2', 'smallserial' => 'int2', 'integer' => 'int4', 'serial' => 'int4', 'int4range' => 'int4range', 'bigint' => 'int8', 'bigserial' => 'int8', 'int8range' => 'int8range', 'interval' => 'interval', 'json' => 'json', 'lseg' => 'lseg', 'macaddr' => 'macaddr', 'money' => 'money', 'decimal' => 'numeric', 'numeric' => 'numeric', 'numrange' => 'numrange', 'path' => 'path', 'point' => 'point', 'polygon' => 'polygon', 'text' => 'text', 'time' => 'time', 'time without time zone' => 'time', 'timestamp' => 'timestamp', 'timestamp without time zone' => 'timestamp', 'timestamp with time zone' => 'timestamptz', 'time with time zone' => 'timetz', 'tsquery' => 'tsquery', 'tsrange' => 'tsrange', 'tstzrange' => 'tstzrange', 'tsvector' => 'tsvector', 'uuid' => 'uuid', 'bit varying' => 'varbit', 'character varying' => 'varchar', 'varchar' => 'varchar', 'xml' => 'xml');
     $arr['name'] = pg_field_name($result, $field_number);
     $arr['table'] = pg_field_table($result, $field_number);
     $arr['max_length'] = pg_field_size($result, $field_number);
     $arr['not_null'] = @pg_field_is_null($result, $field_number, $arr['name']);
     $arr['primary_key'] = -1;
     $arr['unique_key '] = -1;
     $arr['multiple_key'] = -1;
     $arr['numeric'] = -1;
     $arr['blob'] = -1;
     $arr['type'] = $pg_to_php[pg_field_type($result, $file_number)];
     $arr['unsigned'] = -1;
     $arr['zerofill'] = -1;
     return (object) $arr;
 }
开发者ID:vyouzhis,项目名称:phpdbi,代码行数:17,代码来源:pg.php

示例11: fetch_field_direct

 public function fetch_field_direct($offset)
 {
     if ($this->field_count <= $offset || 0 > $offset) {
         return false;
     }
     $type = pg_field_type($this->result, $offset);
     $info = new stdClass();
     $info->name = pg_field_name($this->result, $offset);
     $info->table = pg_field_table($this->result, $offset);
     $info->type = self::$field_types[$type];
     $info->def = null;
     $info->flags = 0;
     if ('bytea' === $type) {
         $field->flags |= 16;
     }
     # BLOB
     /*
     		NOT_NULL_FLAG = 1
     		PRI_KEY_FLAG = 2
     		UNIQUE_KEY_FLAG = 4
     		BLOB_FLAG = 16
     		UNSIGNED_FLAG = 32
     		ZEROFILL_FLAG = 64
     		BINARY_FLAG = 128
     		ENUM_FLAG = 256
     		AUTO_INCREMENT_FLAG = 512
     		TIMESTAMP_FLAG = 1024
     		SET_FLAG = 2048
     		NUM_FLAG = 32768
     		PART_KEY_FLAG = 16384
     		GROUP_FLAG = 32768
     		UNIQUE_FLAG = 65536
     */
     //		$info->orgname  = $info->name;
     //		$info->orgtable = $info->table;
     return $info;
     /*
     		$info->max_length = pg_field_size($this->result, $offset);
     		$info->max_length = pg_field_prtlen($this->result, $offset);
     		decimals   The number of decimals used
     */
 }
开发者ID:cbsistem,项目名称:nexos,代码行数:42,代码来源:pgsql.php

示例12: postgis_connect

    $qtext = $qtext . " LIMIT {$query_limit}";
}
$qtext = $qtext . ";";
//echo $post;
echo $qtext . "\n";
//echo $post . "\n" . $qtext . "\n";
$pgc = postgis_connect();
@($result = pg_query($pgc, $qtext));
pg_close($pgc);
if (!$result) {
    echo '<?xml version="1.0"?>
  <query_result result="ERROR" reason="Error performing query: Query failed in database."/>';
    die;
}
$xml = new SimpleXMLElement("<query_result/>");
$xml->addAttribute("table", pg_field_table($result, 0));
$xml->addAttribute("token", $query_token);
if ($query_limit == "0") {
    $xml->addAttribute("result", "FIELDS");
    for ($i = 0; $i < pg_num_fields($result); $i++) {
        $field = $xml->addChild("field");
        $field->addAttribute("name", pg_field_name($result, $i));
        $field->addAttribute("type", pg_field_type($result, $i));
    }
} else {
    $xml->addAttribute("result", "ROWS");
}
while ($row = pg_fetch_row($result)) {
    $rowXML = $xml->addChild("row");
    for ($i = 0; $i < count($row); $i++) {
        $field = $rowXML->addChild("field", $row[$i]);
开发者ID:rvaidya,项目名称:FlexGIS,代码行数:31,代码来源:query.php

示例13: getFieldInfo

 function getFieldInfo($stack = 0)
 {
     $fields = array();
     $tables = array();
     $num_fields = pg_num_fields($this->result[$stack]);
     for ($i = 0; $i < $num_fields; $i++) {
         $f = new StdClass();
         $f->name = pg_field_name($this->result[$stack], $i);
         $f->table = pg_field_table($this->result[$stack], $i);
         $f->type = pg_field_type($this->result[$stack], $i);
         $f->blob = 0;
         $f->pkey = 0;
         $f->ukey = 0;
         $f->mkey = 0;
         //$f->zerofill = ($meta->flags & ZEROFILL_FLAG) ? 1 : 0;
         //$f->unsigned = ($meta->flags & UNSIGNED_FLAG) ? 1 : 0;
         //$f->autoinc = ($meta->flags & AUTO_INCREMENT_FLAG) ? 1 : 0;
         $f->numeric = substr($f->type, 0, 3) == 'int' ? 1 : 0;
         /*if ($meta->flags & ENUM_FLAG)
         			$f->type = 'enum';
         		else if ($meta->flags & SET_FLAG)
         			$f->type = 'set';
         		else if ($meta->flags & BINARY_FLAG)
         			$f->type = 'binary';
         		else if ($meta->type < 10)
         			$f->type = 'numeric';
         		else
         			$f->type = 'char';
         		if ($f->type == 'enum' || $f->type == 'set')
         			$f->list = $this->getFieldValues($f->table, $f->name);
         		 */
         if (!isset($tables[$f->table])) {
             $tables[$f->table] = array();
         }
         $tables[$f->table][] = "'" . $f->name . "'";
         $fields[] = $f;
     }
     $this->getFieldMetaInfo($fields, $tables);
     $this->getFieldConstraints($fields, $tables);
     return $fields;
 }
开发者ID:onyxnz,项目名称:quartzpos,代码行数:41,代码来源:pgsql.php

示例14: pg_query

echo "<center><h1>Votre requête : " . $req . "</h1>";
$query = pg_query($dbconn, $req);
if (!$query) {
    die("Erreur dans la requete : " . $req);
}
echo "<table border=\"1px\" witdh='50%'>";
echo "<tr>";
for ($i = 0; $i < pg_num_fields($query); $i++) {
    echo "<th>" . pg_field_name($query, $i) . "</th>";
}
echo "</tr>";
for ($i = 0; $i < pg_num_rows($query); $i++) {
    echo "<tr>";
    for ($j = 0; $j < pg_num_fields($query); $j++) {
        if (pg_field_type($query, $j) == "bytea") {
            $table = pg_field_table($query, 0);
            echo "<td><img width='60%' src='photo.php?table=" . $table . "&id=" . pg_field_name($query, 0) . "&valeur=" . pg_fetch_result($query, $i, 0) . "&champ=" . pg_field_name($query, $j) . "'></td>";
        } else {
            echo "<td>" . pg_fetch_result($query, $i, $j) . "</td>";
        }
    }
    echo "</tr>";
}
echo "</table>";
pg_free_result($query);
pg_close($dbconn);
?>
			<a href="formulaire.html"> Retour au formulaire</a><br/>
		</center>
	</body>
</html>
开发者ID:Peter50,项目名称:Website,代码行数:31,代码来源:script.php

示例15: fieldTable

 function fieldTable($rs, $off_set_field)
 {
     if ($this->bd->sgdb == 'MySQL') {
         return mysql_field_table($rs, $off_set_field);
     } else {
         return pg_field_table($rs, $off_set_field);
     }
 }
开发者ID:marcioarp,项目名称:marp-framework,代码行数:8,代码来源:connection.php


注:本文中的pg_field_table函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。