當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。