當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。