当前位置: 首页>>代码示例>>PHP>>正文


PHP model::query方法代码示例

本文整理汇总了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);
 }
开发者ID:ahmatjan,项目名称:huluphp,代码行数:7,代码来源:get_model.class.php

示例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;
     }
 }
开发者ID:hebkia,项目名称:graduation-project,代码行数:9,代码来源:UtilDataModel.class.php

示例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");
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:37,代码来源:IndexAction.class.php

示例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");
 }
开发者ID:dalinhuang,项目名称:concourse,代码行数:15,代码来源:DatabaseAction.class.php

示例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}");
 }
开发者ID:hebkia,项目名称:graduation-project,代码行数:10,代码来源:CheckDataModel.class.php

示例6: uninstall

 public function uninstall()
 {
     $model = new model();
     $model->query("DROP TABLE IF EXISTS `" . C('DB_PREFIX') . "weibobind`");
     return true;
 }
开发者ID:tmlsoft,项目名称:main,代码行数:6,代码来源:weibologin.class.php

示例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;
 }
开发者ID:hebkia,项目名称:graduation-project,代码行数:17,代码来源:CheckApiModel.class.php

示例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);
	}
开发者ID:panhongsheng,项目名称:zl_cms,代码行数:4,代码来源:get_model.class.php

示例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;
 }
开发者ID:tmlsoft,项目名称:main,代码行数:8,代码来源:friendlink.class.php


注:本文中的model::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。