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


PHP PMA_getRelatives函数代码示例

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


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

示例1: PMA_arrayShort

                    $tab_left = PMA_arrayShort($tab_left, $found_table);
                }
            }
            // end while
            return TRUE;
        }
        // end of the "PMA_getRelatives()" function
        $tab_left = PMA_arrayShort($tab_all, $master);
        $tab_know[$master] = $master;
        $run = 0;
        $emerg = '';
        while (count($tab_left) > 0) {
            if ($run % 2 == 0) {
                PMA_getRelatives('master');
            } else {
                PMA_getRelatives('foreign');
            }
            $run++;
            if ($run > 5) {
                foreach ($tab_left as $tab) {
                    $emerg .= ', ' . PMA_backquote($tab);
                    $tab_left = PMA_arrayShort($tab_left, $tab);
                }
            }
        }
        // end while
        $qry_from = PMA_backquote($master) . $emerg . $fromclause;
    }
    // end if ($cfgRelation['relwork'] && count($tab_all) > 0)
}
// end count($Field) > 0
开发者ID:BGCX261,项目名称:zhe-project-agri-hg-to-git,代码行数:31,代码来源:db_qbe.php

示例2: _getFromClause

 /**
  * Provides FROM clause for building SQL query
  *
  * @return string FROM clause
  */
 private function _getFromClause()
 {
     $from_clause = '';
     if (isset($_POST['criteriaColumn']) && count($_POST['criteriaColumn']) > 0) {
         // Initialize some variables
         $all_tables = $all_columns = array();
         // We only start this if we have fields, otherwise it would be dumb
         foreach ($_POST['criteriaColumn'] as $value) {
             $parts = explode('.', $value);
             if (!empty($parts[0]) && !empty($parts[1])) {
                 $table = str_replace('`', '', $parts[0]);
                 $all_tables[$table] = $table;
                 $all_columns[] = $table . '.' . str_replace('`', '', $parts[1]);
             }
         }
         // end while
         // Create LEFT JOINS out of Relations
         if (count($all_tables) > 0) {
             // Get tables and columns with valid where clauses
             $valid_where_clauses = $this->_getWhereClauseTablesAndColumns();
             $where_clause_tables = $valid_where_clauses['where_clause_tables'];
             $where_clause_columns = $valid_where_clauses['where_clause_columns'];
             // Get master table
             $master = $this->_getMasterTable($all_tables, $all_columns, $where_clause_columns, $where_clause_tables);
             $from_clause = PMA_Util::backquote($master) . PMA_getRelatives($all_tables, $master);
         }
         // end if (count($all_tables) > 0)
     }
     // end count($_POST['criteriaColumn']) > 0
     // In case relations are not defined, just generate the FROM clause
     // from the list of tables, however we don't generate any JOIN
     if (empty($from_clause) && isset($all_tables)) {
         $from_clause = implode(', ', $all_tables);
     }
     return $from_clause;
 }
开发者ID:mercysmart,项目名称:naikelas,代码行数:41,代码来源:DBQbe.class.php


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