本文整理汇总了PHP中model::query方法的典型用法代码示例。如果您正苦于以下问题:PHP model::query方法的具体用法?PHP model::query怎么用?PHP model::query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model
的用法示例。
在下文中一共展示了model::query方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sql_query
public function sql_query($sql)
{
if (!empty($this->db_tablepre)) {
$sql = str_replace('phpcms_', $this->db_tablepre, $sql);
}
return parent::query($sql);
}
示例2: getRandomLessonMsg
public function getRandomLessonMsg($num)
{
if (isset($num)) {
$xueyuan = new model("xueyuan", "", "");
$xueyuanList = $xueyuan->query("SELECT * FROM zhuanyelesson WHERE l_studentxueyuan IN (SELECT xy_name FROM xueyuan)");
} else {
return false;
}
}
示例3: main
public function main()
{
$Article = D('Article');
$Member = D('Member');
$Job = D('Job');
$Feedback = D('Feedback');
$ArticleC = $Article->count();
$MemberC = $Member->count();
$JobC = $Job->count();
$FeedbackC = $Feedback->count();
$this->assign(array('ArticleC' => $ArticleC, 'MemberC' => $MemberC, 'JobC' => $JobC, 'FeedbackC' => $FeedbackC));
//获取系统信息
$config = new model();
$array = array();
$serverinfo = PHP_OS . ' / PHP v' . PHP_VERSION;
$serverinfo .= @ini_get('safe_mode') ? ' Safe Mode' : NULL;
$dbversion = $config->query("SELECT VERSION()");
$fileupload = @ini_get('file_uploads') ? ini_get('upload_max_filesize') : '<font color="red">不支持上传</font>';
$dbsize = 0;
$tablepre = C('DB_PREFIX');
$query = $tables = $config->query("SHOW TABLE STATUS LIKE '{$tablepre}%'");
//dump($query);
foreach ($tables as $table) {
$dbsize += $table['Data_length'] + $table['Index_length'];
}
$dbsize = $dbsize ? RealSize($dbsize) : '未知大小';
$dbversion = $config->query("SELECT VERSION()");
$magic_quote_gpc = get_magic_quotes_gpc() ? 'On' : 'Off';
$array['serverinfo'] = $serverinfo;
$array['dbversion'] = $dbversion;
$array['fileupload'] = $fileupload;
$array['dbsize'] = $dbsize;
$array['dbversion'] = $dbversion[0]['VERSION()'];
$array['magic_quote_gpc'] = $magic_quote_gpc;
$this->assign($array);
$this->display("Public:main");
}
示例4: executesql
public function executesql()
{
$db = new model();
$sql = $_POST['sql'];
$sql = stripslashes($sql);
$this->assign('sql', $sql);
$l = $db->query($sql);
if ($l !== false) {
$type = 1;
} else {
$type = 0;
}
$this->assign('type', $type);
$this->display("exesql");
}
示例5: getClassList
public function getClassList($pagefirst, $pagesize)
{
$check = new model("checkrecord", "", "");
$num = $check->query("SELECT COUNT(DISTINCT record_class) AS num FROM checkrecord");
$num = $num[0]['num'];
import('ORG.Util.Page');
$page = new page($num, $pagesize);
$this->page = $page->show();
return $this->query("SELECT DISTINCT record_class FROM checkrecord LIMIT {$pagefirst},{$pagesize}");
}
示例6: uninstall
public function uninstall()
{
$model = new model();
$model->query("DROP TABLE IF EXISTS `" . C('DB_PREFIX') . "weibobind`");
return true;
}
示例7: getUserMsg
public function getUserMsg($username, $password)
{
$Msg = array();
$login = new model('teacher', '', '');
$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);
$info = $login->query("SELECT tech_id FROM teacher WHERE tech_name = '" . $username . "' AND password = '" . $password . "'");
if (!empty($info[0]['tech_id'])) {
$Msg['status'] = true;
$Msg['msg'] = "登录成功";
$Msg['userid'] = $info[0]['tech_id'];
} else {
$Msg['status'] = false;
$Msg['msg'] = "用户名或密码错误";
}
return $Msg;
}
示例8: sql_query
public function sql_query($sql) {
if (!empty($this->db_tablepre)) $sql = str_replace('ZLCMS_', $this->db_tablepre, $sql);
return parent::query($sql);
}
示例9: uninstall
public function uninstall()
{
$model = new model();
$model->query("DROP TABLE IF EXISTS `" . C('DB_PREFIX') . "friendlink`");
$model->query("DELETE FROM `" . C('DB_PREFIX') . "system` WHERE `name`='flinkpos'");
$this->cacheupdate();
return true;
}