本文整理汇总了PHP中db::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP db::__construct方法的具体用法?PHP db::__construct怎么用?PHP db::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类db
的用法示例。
在下文中一共展示了db::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mostrar_usuarios
public function mostrar_usuarios()
{
$array = array();
parent::__construct($this->db, $this->tabla);
parent::select($array);
parent::mostrar_resultados();
}
示例2: __construct
public function __construct($__host, $__user, $__passwd)
{
$query = "SELECT * from ";
$this->_bigcategory = array();
$this->_middlecategory = array();
$this->_city = new City($__host, $__user, $__passwd);
parent::__construct($__host, $__user, $__passwd);
// get category name
$result = $this->_db_throw_query("Foodstuff", $query . "Foodstuff.Big_Category_List;");
if (!$result) {
print "Quely Failed.\n" . mysqli_error($this->_connection);
return NULL;
}
while ($records = mysqli_fetch_assoc($result)) {
$this->_bigcategory[$records['Big_Category_ID']] = $records['Big_Category_Name'];
}
$result = $this->_db_throw_query("Foodstuff", $query . "Foodstuff.Middle_Category_List;");
if (!$result) {
print "Quely Failed.\n" . mysqli_error($this->_connection);
return NULL;
}
while ($records = mysqli_fetch_assoc($result)) {
$big = $records['Middle_Category_ID'][0];
$middle = $records['Middle_Category_ID'][1];
$this->_middlecategory[$big][$middle] = $records['Middle_Category_Name'];
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->iv = mcrypt_create_iv(mcrypt_get_block_size(MCRYPT_TripleDES, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM);
$this->key = 'LeeS1bae';
$this->delimiter = '%%';
}
示例4: __construct
public function __construct($config = array())
{
parent::__construct($config);
$this->debug = $config["debug"] ? $config["debug"] : false;
$this->prefix = $config['prefix'] ? $config['prefix'] : 'qinggan_';
$this->_config_db($config);
}
示例5: __construct
public function __construct($loginRequired = true)
{
// call parent constuctor
parent::__construct();
// Start SESSION if not started
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
// Set SESSION ADMIN Login Flag to false if not set
if (!isset($_SESSION['LOGGEDIN'])) {
$_SESSION['LOGGEDIN'] = false;
}
// Redirect the user if NOT logged in
if (!$_SESSION['LOGGEDIN'] && $loginRequired) {
header("Location: index.php?flg=expired");
exit;
}
// Fetch the Logged in users details if login is required
if ($loginRequired) {
$this->usr = $this->query('SELECT * FROM `users` WHERE `id` = ' . $_SESSION['USERID'] . ' LIMIT 1')->fetch(PDO::FETCH_ASSOC);
// get the user details
}
// Check if Message Flag is set
if (isset($_GET["flg"])) {
$this->flg = $_GET["flg"];
}
}
示例6: __construct
public function __construct()
{
try {
parent::__construct();
} catch (MysqlException $e) {
Html::showAll($e);
}
}
示例7: get_ingredientes
public function get_ingredientes()
{
$array = array();
parent::__construct($this->db, $this->tabla);
parent::select($array);
$this->resultado = parent::__get("resultado");
var_dump($this->resultado);
}
示例8: __construct
public function __construct($__host, $__user, $__passwd, $__uid)
{
$this->kind = array(0 => "main", 1 => "dish", 2 => "sub");
$this->week = array(0 => "Mon", 1 => "Tue", 2 => "Wed", 3 => "Thu", 4 => "Fri", 5 => "Sat", 6 => "Sun");
parent::__construct($__host, $__user, $__passwd);
$query = "CREATE TABLE UM" . $__uid . " ( Menu_Name text, Kind_Name varchar(10), Date DATE );";
$result = $this->_db_throw_query("Users_Geo", $query);
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->NowArtPage = 1;
$this->DataTemp = false;
$this->NewDataTemp = array();
$this->PageTemp = array();
$this->Indicators = '<div style="page-break-after: always; "><span style="DISPLAY:none"> </span></div>';
$this->TextName = 'text';
}
示例10: __construct
public function __construct($tableName = '')
{
//如果没有设置表名,则自动根据Model名取表名
if (null != $tableName && "" == $this->table) {
$this->table = $tableName;
}
//如果没有设置数据库配置文件,读取默认文件
if (null == $this->_dbConfig) {
$this->_dbConfig = registry::getRegistry('db');
}
parent::__construct($this->_dbConfig);
}
示例11: __construct
public function __construct()
{
global $db;
parent::__construct(false, $db);
$this->tableName = 'product_type';
$this->Cshu = 'id,title,UPID';
$this->sort = 'ranking';
$this->FID = 'id';
$this->ZID = 'UPID';
$this->SQL = null;
$this->new_arr = array();
}
示例12: __construct
public function __construct()
{
parent::__construct();
global $configDetails;
$themeDetails = $this->getRequiredFieldsSingle('site_themes', "theme_status=? ORDER BY theme_id ASC LIMIT 0,1", $conditionValue = array('1'), 'theme_path');
if ($themeDetails['theme_path'] != '') {
$theme_path = _output($themeDetails['theme_path']);
} else {
$theme_path = DEFAULT_THEME_PATH;
}
$this->urlBase = $configDetails['sitePath'];
// site path from config file(config.php)
$this->urlAssetsBase = $configDetails['sitePath'] . $theme_path;
$this->urlImageBase = $configDetails['sitePath'] . $theme_path . $configDetails['imagesDirectory'];
}
示例13: SqlPager
/**
* Constructor
*/
function SqlPager($query, $totalRows, $conditionValues, $page_link = "", $items_per_page = 25, $dbDetails)
{
$query = preg_replace("/LIMIT [0-9]+,[0-9]+/i", "", $query);
//Remove the LIMIT option if there is one.
//Get all the options that must be there.
$this->query = $query;
parent::__construct($dbDetails);
//Number of items that must be displayed in one page.
$this->items_per_page = $_REQUEST['items_per_page'] ? (int) $_REQUEST['items_per_page'] : (int) $items_per_page;
$items_per_page = $this->items_per_page;
//The pager is located in which page... Used to give the page numbers as a GET request.
$page_link = $page_link ? $page_link : basename($_SERVER['PHP_SELF']) . '?';
$last_char = $page_link[strlen($page_link) - 1];
if ($last_char != '&' and $last_char != '?') {
//If the given page dont end with a ? or a &,
if (strpos($page_link, '?') === false) {
$page_link .= '?';
} else {
$page_link .= '&';
}
//If there is a '?', add a '&' at the end.
}
//Add the items per page option to the page link.
if ($_REQUEST['items_per_page']) {
$page_link .= "items_per_page={$items_per_page}&";
}
$this->_page_link = $page_link;
$this->page = $_REQUEST['page'] ? $_REQUEST['page'] : 1;
//Get the current page we are on.
//Get the total number of items.
//$this->prepareConditionStatement($query,$conditionValues);
//$sql_count=$this->getAffectedRows();
$this->_total_items = $totalRows;
$this->_total_pages = ceil($this->_total_items / $items_per_page);
//And total pages
}
示例14: __construct
public function __construct($__host, $__user, $__passwd)
{
parent::__construct($__host, $__user, $__passwd);
}
示例15:
function __construct()
{
$this->table = str_replace("Model", "", get_class($this));
parent::__construct(APP::$config['db']);
}