本文整理汇总了PHP中app\DB::query方法的典型用法代码示例。如果您正苦于以下问题:PHP DB::query方法的具体用法?PHP DB::query怎么用?PHP DB::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\DB
的用法示例。
在下文中一共展示了DB::query方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$connect = new DB('connect_param.php');
$welcome = $connect->query('SELECT * FROM welcome', []);
$this->welcome = $welcome;
}
示例2: oath
public static function oath($email, $password)
{
$p = DB::query()->select('password', 'id')->from('user')->where('email', '=', $email)->and_where('`check-e`', '=', 1)->execute()->current();
if ($p === false) {
return false;
}
$data = unserialize($p['password']);
$user = new Users();
if ($user->hash_check($password, $data['hash'], $data['salt'])) {
STD::set_cookie('rememberme', $p['id']);
return true;
}
return false;
}
示例3: dirname
//include dirname(__DIR__)."/vendor/autoload.php";
//NAMESPACE APP
$app = new app();
$constante = new constante();
$date_format = new date_format();
$fonction = new fonction();
$DB = new DB();
$ssh2 = new ssh2();
//NAMESPACE API
$push_cls = new push();
//NAMESPACE ASC
$salarie_cls = new salarie();
$presta_cls = new prestation();
//NAMESPACE CONFIG
$mod_cls = new modules();
if (isset($_SESSION['account']['connect']) && $_SESSION['account']['connect'] == 1) {
$user = $DB->query("SELECT * FROM users WHERE pseudo = :pseudo", array("pseudo" => $_SESSION['account']['pseudo']));
}
//Import des Informations de configuration
$mod_salarie = $mod_cls->active_salarie();
$mod_prestation = $mod_cls->active_prestation();
$mod_billetterie = $mod_cls->active_billetterie();
$mod_remboursement = $mod_cls->active_remboursement();
$mod_residente = $mod_cls->active_non_residente();
$conf_salarie = $mod_cls->salarie();
$conf_presta = $mod_cls->prestation();
$conf_billetterie = $mod_cls->billetterie();
$conf_remboursement = $mod_cls->remboursement();
//COMPOSER
require dirname(__DIR__) . "/vendor/autoload.php";
use Ifsnop\Mysqldump as IMysqldump;
示例4: __construct
public function __construct()
{
$connect = new DB('connect_param.php');
$train = $connect->query('SELECT * FROM train', []);
$this->train = $train;
}
示例5: get_var
/**
* возращает значение сохраненной переменой
* @param $name string название переменной
* @return mixed false если не существует поля $name
*/
public static function get_var($name)
{
$val = DB::query()->select('value')->from(DB::$var)->where('var_name', '=', $name)->execute()->current('value');
if ($val) {
return unserialize($val);
} else {
return false;
}
}
示例6: realpath
<?php
use App\DB;
define('EXT', '.php');
define('DOCROOT', realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
define('APPPATH', realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'Application' . DIRECTORY_SEPARATOR);
require_once APPPATH . 'autoload' . EXT;
$file = DOCROOT . 'install/sql.sql';
$all = file_get_contents($file);
$sql = preg_split('/;/', $all);
foreach ($sql as $item) {
if ($item != '') {
$res = DB::query($item)->execute()->_error;
if ($res == '') {
echo "<pre>Таблица создана успешна</pre>";
} else {
echo "<pre>{$res}</pre>";
}
}
}
示例7: __construct
public function __construct()
{
$connect = new DB('connect_param.php');
$gallery = $connect->query('SELECT * FROM gallery', []);
$this->gallery = $gallery;
}