當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Db::__construct方法代碼示例

本文整理匯總了PHP中Db::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Db::__construct方法的具體用法?PHP Db::__construct怎麽用?PHP Db::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Db的用法示例。


在下文中一共展示了Db::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(array $db_settings, RegistryInterface $registry)
 {
     $db_setting = array('server' => $db_settings['server'], 'database' => $db_settings['db'], 'username' => $db_settings['db_cred']['user']['user'], 'password' => $db_settings['db_cred']['user']['password']);
     //I know; the credentials seem too long
     parent::__construct($db_setting);
     $this->registry = $registry;
 }
開發者ID:General-ZOD,項目名稱:eduvideo,代碼行數:7,代碼來源:dbcategories.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     if (!isset($_GET['action'])) {
         $this->drawTable();
     } else {
         switch ($_GET['action']) {
             case 'create':
                 $this->createPromo();
                 break;
             case 'save':
                 $this->savePromo($_GET['id']);
                 break;
             case 'edit':
                 $this->drawTableID($_GET['id']);
                 $this->selected_id = $_GET['id'];
                 break;
             case 'delete':
                 $this->deletePromo($_GET['id']);
                 break;
             default:
                 break;
         }
     }
     $this->drawList();
     $this->CKEditor();
     $this->bottomSpace();
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:28,代碼來源:ajax_promo.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $this->action = isset($_GET['vis']) ? $_GET['vis'] : false;
     $this->artsgruppe = isset($_GET['artsgruppe']) ? $_GET['artsgruppe'] : false;
     switch ($this->action) {
         case 'total':
             $this->total();
             break;
         case 'arter':
             $this->arter();
             break;
         case 'select':
             $this->select();
             break;
         case 'klassifikation':
             $this->klassifikation();
             break;
         case 'referencer':
             $this->referencer();
             break;
         default:
             break;
     }
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:25,代碼來源:index.php

示例4: __construct

 public function __construct()
 {
     parent::__construct();
     $this->drawHeader();
     $this->loadData();
     $this->populate();
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:7,代碼來源:19082012_search.php

示例5: __construct

 public function __construct($dbHost = null)
 {
     parent::__construct($dbHost);
     if (is_null($this->dbhost)) {
         die("MySQL hostname not set");
     } else {
         if (is_null($this->dbname)) {
             die("MySQL database not selected");
         } else {
             if (is_null($this->dbuser)) {
                 die("MySQL hostname not set");
             } else {
                 if (is_null($this->dbpwd)) {
                     die("MySQL pwd not currect");
                 }
             }
         }
     }
     if (!$this->link_id) {
         $this->link_id = mysql_connect($this->hostname, $this->dbuser, $this->dbpwd);
     }
     mysql_query("SET NAMES UTF-8", $this->link_id);
     if ($this->dbname) {
         mysql_select_db($this->dbname, $this->link_id);
     }
 }
開發者ID:hoogle,項目名稱:ttt,代碼行數:26,代碼來源:db_mysql_FIXME.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     if (!isset($_GET['action'])) {
         echo 'Programfejl ..';
         return;
     }
     switch ($_GET['action']) {
         case 'backup':
             $this->createBackup();
             break;
         case 'showtables':
             $this->showTables();
             break;
         case 'updateDK':
             $this->updateDK();
             break;
         case 'updateCRLF':
             $this->updateCRLF();
             break;
         case 'restoreBackup':
             $this->restoreBackup();
             break;
         default:
             return;
     }
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:27,代碼來源:ajax_db.php

示例7: __construct

 public function __construct($ssTabaleName = '', $ssAlias = '', $ssPrimaryKey = '')
 {
     $this->ssTableName = $ssTabaleName;
     $this->ssAlias = $ssAlias;
     $this->ssPrimaryKey = $ssPrimaryKey;
     parent::__construct();
 }
開發者ID:hardikpatel1644,項目名稱:phpoops,代碼行數:7,代碼來源:model.php

示例8: __construct

 public function __construct()
 {
     try {
         parent::__construct();
     } catch (MysqlException $e) {
         Html::showAll($e);
     }
 }
開發者ID:HuMMeL621,項目名稱:KBO,代碼行數:8,代碼來源:class.lehrer.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $this->createLog();
     $this->insertRequests();
     //return log_id as response, caller may use it to something ...
     echo $this->log_id;
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:8,代碼來源:ajax_log.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     if (isset($_GET['artsgruppe']) || isset($_GET['artsgruppedk'])) {
         //$this->artsgruppe=$this->getArtsgruppe();
         $this->artsgruppe = isset($_GET['artsgruppe']) ? $_GET['artsgruppe'] : $_GET['artsgruppedk'];
     }
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:8,代碼來源:meta.php

示例11: __construct

 public function __construct($name, $email, $password)
 {
     parent::__construct();
     $this->name = $name;
     $this->password = $password;
     $this->email = $email;
     $this->id = 0;
 }
開發者ID:bogwien,項目名稱:first.mystore.loc,代碼行數:8,代碼來源:User.php

示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $taxon = isset($_GET['taxon']) ? $_GET['taxon'] : '';
     if ($taxon != '') {
         $this->getCOF_URL($taxon);
     }
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:8,代碼來源:cof.php

示例13: __construct

 public function __construct()
 {
     parent::__construct();
     $get = isset($_GET['get']) ? $_GET['get'] : 'Rige';
     $parent = isset($_GET['parent']) ? $_GET['parent'] : '';
     $base = isset($_GET['base']) ? $_GET['base'] : '';
     $this->load($get, $parent, $base);
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:8,代碼來源:hierarchy.php

示例14: __construct

 public function __construct()
 {
     parent::__construct();
     mysql_set_charset('utf8');
     if (!$this->getExclusive()) {
         $this->getRandom();
     }
     $this->getTeasers();
 }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:9,代碼來源:promo.php

示例15: __construct

    public function __construct($char)
    {
        parent::__construct();
        $this->style();
        if (!isset($_GET['arter'])) {
            $this->arter = 'da';
            $this->ca = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'z', 'Æ', 'Ø', 'Å');
        } else {
            switch ($_GET['arter']) {
                case 'int':
                    $this->arter = 'int';
                    $this->ca = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'z');
                    break;
                default:
                    $this->arter = 'da';
                    $this->ca = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'y', 'z', 'Æ', 'Ø', 'Å');
                    break;
            }
        }
        echo '<div style="padding-left:20px;">';
        ?>
			<a href="/" id="show-search-simple" style="text-decoration:none;">&#171;&nbsp;Simpel søgning</a>
			&nbsp;>&nbsp;
			<a href="http://allearter.dk/" style="text-decoration:none;">Projekt Allearter Startside</a>
			<br><br>
			<h1>Artsregister - alle arter A - Å</h1>
			<br>
<?php 
        $this->arterMenu();
        $this->char = in_array($char, $this->ca) ? $char : 'a';
        if ($this->arter == 'da') {
            $SQL = 'select Videnskabeligt_navn, Dansk_navn from allearter where Dansk_navn like "' . $this->char . '%" order by Dansk_navn asc';
        } else {
            $SQL = 'select Videnskabeligt_navn, Dansk_navn from allearter where Dansk_navn="" and Videnskabeligt_navn like "' . $this->char . '%" order by Videnskabeligt_navn asc';
        }
        $header = '<h1 class="taksonomi">' . ucfirst($this->char) . '</h1>';
        //echo $SQL;
        mysql_set_charset('utf8');
        $result = $this->query($SQL);
        echo '<div class="header-cnt">';
        echo $header;
        $this->leftMenu();
        echo '</div>';
        echo '<div class="sitemap-cnt"><br/>';
        while ($row = mysql_fetch_array($result)) {
            $taxon = str_replace(' ', '+', $row['Videnskabeligt_navn']);
            if ($this->arter == 'da') {
                echo '<a class="taksonomi" href="?taxon=' . $taxon . '"><strong>' . $row['Dansk_navn'] . '</strong>&nbsp;&nbsp;<i style="font-family:times,serif;color:black;">' . $row['Videnskabeligt_navn'] . '</i></a><br>';
            } else {
                echo '<a class="taksonomi" href="?taxon=' . $taxon . '"><i style="font-size:1.1em;">' . $row['Videnskabeligt_navn'] . '</i></a><br>';
            }
        }
        echo '<br/></div>';
        //01032015
        echo '</div>';
    }
開發者ID:davidkonrad,項目名稱:allearter,代碼行數:56,代碼來源:sitemap.php


注:本文中的Db::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。