本文整理汇总了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;
}
示例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();
}
示例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;
}
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->drawHeader();
$this->loadData();
$this->populate();
}
示例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);
}
}
示例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;
}
}
示例7: __construct
public function __construct($ssTabaleName = '', $ssAlias = '', $ssPrimaryKey = '')
{
$this->ssTableName = $ssTabaleName;
$this->ssAlias = $ssAlias;
$this->ssPrimaryKey = $ssPrimaryKey;
parent::__construct();
}
示例8: __construct
public function __construct()
{
try {
parent::__construct();
} catch (MysqlException $e) {
Html::showAll($e);
}
}
示例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;
}
示例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'];
}
}
示例11: __construct
public function __construct($name, $email, $password)
{
parent::__construct();
$this->name = $name;
$this->password = $password;
$this->email = $email;
$this->id = 0;
}
示例12: __construct
public function __construct()
{
parent::__construct();
$taxon = isset($_GET['taxon']) ? $_GET['taxon'] : '';
if ($taxon != '') {
$this->getCOF_URL($taxon);
}
}
示例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);
}
示例14: __construct
public function __construct()
{
parent::__construct();
mysql_set_charset('utf8');
if (!$this->getExclusive()) {
$this->getRandom();
}
$this->getTeasers();
}
示例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;">« Simpel søgning</a>
>
<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> <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>';
}