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


PHP get_table函数代码示例

本文整理汇总了PHP中get_table函数的典型用法代码示例。如果您正苦于以下问题:PHP get_table函数的具体用法?PHP get_table怎么用?PHP get_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checklogin

 /**
  * 用户登录检查
  *
  */
 public function checklogin()
 {
     $this->_globals();
     $_POST["username"] = strtolower($_POST["username"]);
     $rs = $this->mCustomer->checkLogin();
     if ($rs) {
         $sql = "SELECT * FROM " . get_table("customers") . " WHERE email = '" . $_POST["username"] . "'";
         $r = $this->mDb->getRow($sql);
         if ($r["status"] == 1) {
             $msg["status"] = "true";
             $this->mCustomer->upHits($_SESSION["login_user"]["id"]);
             $_SESSION["login_user"] = $r;
             $msg["message"] = "登录成功";
             $this->mLog->userLog("前台登录成功");
         } else {
             $msg["status"] = "false";
             $msg["message"] = "您的邮箱还没有验证,请查看邮件进行验证";
         }
     } else {
         $msg["status"] = "false";
         $msg["message"] = "错误的用户名或密码";
         $_SESSION["tmpuser"] = $_POST["username"];
     }
     echo json_encode($msg);
     die;
 }
开发者ID:hetykai,项目名称:feidaoyu,代码行数:30,代码来源:login.class.php

示例2: init

 /**
  * 系统初始化
  */
 private static function init()
 {
     set_exception_handler(array('AWS_APP', 'exception_handle'));
     self::$config = load_class('core_config');
     self::$db = load_class('core_db');
     self::$plugins = load_class('core_plugins');
     self::$settings = self::model('setting')->get_settings();
     if ((!defined('G_SESSION_SAVE') or G_SESSION_SAVE == 'db') and get_setting('db_version') > 20121123) {
         Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable(array('name' => get_table('sessions'), 'primary' => 'id', 'modifiedColumn' => 'modified', 'dataColumn' => 'data', 'lifetimeColumn' => 'lifetime')));
         self::$session_type = 'db';
     }
     Zend_Session::setOptions(array('name' => G_COOKIE_PREFIX . '_Session', 'cookie_domain' => G_COOKIE_DOMAIN));
     if (G_SESSION_SAVE == 'file' and G_SESSION_SAVE_PATH) {
         Zend_Session::setOptions(array('save_path' => G_SESSION_SAVE_PATH));
     }
     Zend_Session::start();
     self::$session = new Zend_Session_Namespace(G_COOKIE_PREFIX . '_Anwsion');
     if ($default_timezone = get_setting('default_timezone')) {
         date_default_timezone_set($default_timezone);
     }
     if ($img_url = get_setting('img_url')) {
         define('G_STATIC_URL', $img_url);
     } else {
         define('G_STATIC_URL', base_url() . '/static');
     }
     if (self::config()->get('system')->debug) {
         if ($cornd_timer = self::cache()->getGroup('crond')) {
             foreach ($cornd_timer as $cornd_tag) {
                 if ($cornd_runtime = self::cache()->get($cornd_tag)) {
                     AWS_APP::debug_log('crond', 0, 'Tag: ' . str_replace('crond_timer_', '', $cornd_tag) . ', Last run time: ' . date('Y-m-d H:i:s', $cornd_runtime));
                 }
             }
         }
     }
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:38,代码来源:aws_app.inc.php

示例3: defshow

 public function defshow()
 {
     //检查登录
     if (!$_SESSION["login_user"]) {
         $_SESSION["fromurl"] = $_SERVER["HTTP_REFERER"];
         header("Location: /user/login.html");
     } else {
         $this->result["login_user"] = $_SESSION["login_user"];
     }
     $this->result["sites"]["pagetitle"] = "课程设置";
     $this->result["nav1"] = $this->mArt->getPidLists(7);
     // 项目
     $this->result["nav2"] = $this->mArt->getPidLists(10);
     // 招生
     $this->result["logout"] = $this->mClient->isOrLogin();
     $this->result["sites"]["course"] = 'current';
     $this->result["ads"]["indexlbanner"] = $this->mAd->getAd("indexlbanner", "list");
     $sql1 = "select id,cname from " . get_table("art_cates") . " where pid = 14";
     $info = $this->mDb->getall($sql1);
     $this->result["info"] = $info;
     $sql2 = "select c.id as cid,a.id as aid,a.title from sb_art_cates AS c,sb_articles AS a where c.id=a.class_id and c.id in (select id from sb_art_cates where pid = 14)";
     $rs = $this->mDb->getall($sql2);
     $this->result["rs"] = $rs;
     $sql3 = "select id,cname from " . get_table("art_cates") . " where pid = 23";
     $infos = $this->mDb->getall($sql3);
     $this->result["infos"] = $infos;
     $sql4 = "select c.id as cid,a.id as aid,a.title from sb_art_cates AS c,sb_articles AS a where c.id=a.class_id and c.id in (select id from sb_art_cates where pid = 23)";
     $rse = $this->mDb->getall($sql4);
     $this->result["rse"] = $rse;
     $this->tplname = $_GET["lang"] . '/course';
 }
开发者ID:yfg2014,项目名称:yangphp_4,代码行数:31,代码来源:course.class.php

示例4: batch

 public function batch()
 {
     $this->_globals();
     //$rs = $this->mArticle->Batch();
     $i = 0;
     while ($i < count($_POST["selected"])) {
         if ($_POST["more"] == "0") {
             $sql = "DELETE FROM " . get_table("download") . " WHERE id=" . $_POST["selected"][$i];
         } else {
             $sql = "UPDATE " . get_table("download") . " SET class_id='" . $_POST["class_id"] . "' WHERE id=" . $_POST["selected"][$i];
         }
         $rs = $this->mDb->execute($sql);
         $i++;
     }
     $this->mLog->adminLog("批量移动/删除内容");
     /*if($rs)
      				{
      					$msg["status"] = "true";
      				}
      				else
      				{
      					$msg["false"] = "true";
      					$msg["message"] = "保存错误,请联系管理员";
     
      				}
      				echo json_encode($msg);*/
     die;
 }
开发者ID:hetykai,项目名称:feidaoyu,代码行数:28,代码来源:download.class.php

示例5: revert

 function revert()
 {
     $this->build();
     $sql = "SELECT * FROM " . get_table("backuplist") . " WHERE id=" . $_POST["dataid"];
     $rs = $this->mDb->getrow($sql);
     $path = $rs["path"] . $rs["filename"];
     system("mysql -h " . _DB_HOST . " -u " . _DB_USER . " -p" . _DB_PASS . " " . _DB_NAME . " < " . $this->mPath . "/" . $rs["filename"]);
 }
开发者ID:yfg2014,项目名称:yangphp_4,代码行数:8,代码来源:Database.class.php

示例6: db_clean

 public function db_clean()
 {
     $users_columns = $this->query_all("SHOW COLUMNS FROM `" . get_table('users') . "`");
     foreach ($users_columns as $key => $val) {
         if (in_array($val['Field'], array('avatar_type', 'url'))) {
             $this->query("ALTER TABLE `" . get_table('users') . "` DROP `" . $val['Field'] . "`;");
         }
     }
 }
开发者ID:Vizards,项目名称:HeavenSpree,代码行数:9,代码来源:upgrade.php

示例7: count_favorite_items

 public function count_favorite_items($uid, $tag = null)
 {
     if ($tag) {
         $favorite_items = $this->query_all('SELECT DISTINCT item_id FROM ' . get_table('favorite_tag') . ' WHERE uid = ' . intval($uid) . " AND title = '" . $this->quote($tag) . "'");
         return sizeof($favorite_items);
     } else {
         return $this->count('favorite', 'uid = ' . intval($uid));
     }
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:9,代码来源:favorite.php

示例8: get_topics_by_feature_id

 public function get_topics_by_feature_id($feature_id)
 {
     if (!($topics = $this->query_all('SELECT topic_id FROM ' . get_table('feature_topic') . ' WHERE feature_id = ' . intval($feature_id)))) {
         return false;
     }
     foreach ($topics as $key => $val) {
         $topic_ids[] = $val['topic_id'];
     }
     return $topic_ids;
 }
开发者ID:egogg,项目名称:wecenter-dev,代码行数:10,代码来源:feature.php

示例9: _saveAnswer

 public static function _saveAnswer($aid, $qid, $username, $content, $vote)
 {
     $a = get_table('answer');
     $update = array('id' => $aid, 'q_id' => $qid, 'user' => $username, 'text' => $content, 'vote' => $vote, 'fetched' => time());
     $where = array('id' => $aid);
     $rs = $a->update($where, array('$set' => $update), array('upsert' => true));
     if (!$rs['ok']) {
         echo basename(__FILE__) . ':' . __LINE__ . ' ' . $rs['err'] . "\n";
     }
     return $rs;
 }
开发者ID:linzelong,项目名称:zhihu-archive,代码行数:11,代码来源:Answer.php

示例10: savePost

 public function savePost()
 {
     foreach ($_POST as $key => $val) {
         $sql[] = $key . " = '{$val}'";
     }
     $sql = implode(",", $sql);
     $sql = "UPDATE " . get_table("sites") . " SET {$sql} WHERE id=1";
     $rs = $this->mDb->execute($sql);
     $this->building();
     return $rs;
 }
开发者ID:yfg2014,项目名称:yangphp_4,代码行数:11,代码来源:Site.class.php

示例11: pay_to_project_order_id

 public function pay_to_project_order_id($order_id, $project_product_order_id)
 {
     if (!($order_info = $this->get_order($order_id))) {
         return false;
     }
     if (!($project_order_info = $this->model('project')->get_project_order_info_by_id($project_product_order_id))) {
         return false;
     }
     $this->query("UPDATE " . get_table('project') . " SET paid = paid + " . $order_info['amount'] . " WHERE id = " . intval($project_order_info['project_id']));
     return $this->set_order_payment_time($project_product_order_id);
 }
开发者ID:elelianghh,项目名称:wecenter,代码行数:11,代码来源:payment.php

示例12: update_dialog_count

 public function update_dialog_count($dialog_id, $uid)
 {
     if (!($inbox_dialog = $this->get_dialog_by_id($dialog_id))) {
         return false;
     }
     $this->update('inbox_dialog', array('sender_count' => $this->count('inbox', 'uid IN(' . $inbox_dialog['sender_uid'] . ', ' . $inbox_dialog['recipient_uid'] . ') AND sender_remove = 0 AND dialog_id = ' . intval($dialog_id)), 'recipient_count' => $this->count('inbox', 'uid IN(' . $inbox_dialog['sender_uid'] . ', ' . $inbox_dialog['recipient_uid'] . ') AND recipient_remove = 0 AND dialog_id = ' . intval($dialog_id)), 'update_time' => time()), 'id = ' . intval($dialog_id));
     if ($inbox_dialog['sender_uid'] == $uid) {
         $this->query("UPDATE " . get_table('inbox_dialog') . " SET recipient_unread = recipient_unread + 1 WHERE id = " . intval($dialog_id));
     } else {
         $this->query("UPDATE " . get_table('inbox_dialog') . " SET sender_unread = sender_unread + 1 WHERE id = " . intval($dialog_id));
     }
 }
开发者ID:Gradven,项目名称:what3.1.7,代码行数:12,代码来源:message.php

示例13: search_users

 public function search_users($q, $page, $limit = 20)
 {
     if (is_array($q) and sizeof($q) > 1) {
         $where[] = "user_name = '" . $this->quote(implode(' ', $q)) . "' OR user_name = '" . $this->quote(implode('', $q)) . "'";
     } else {
         if (is_array($q)) {
             $q = implode('', $q);
         }
         $where[] = "user_name LIKE '" . $this->quote($q) . "%'";
     }
     return $this->query_all('SELECT uid, last_login FROM ' . get_table('users') . ' WHERE ' . implode(' OR ', $where), calc_page_limit($page, $limit));
 }
开发者ID:xuechenli,项目名称:NUAA-Question-Answering,代码行数:12,代码来源:search.php

示例14: get_reason

function get_reason($reason)
{
    global $db, $L;
    $str = '';
    $arr = explode('|', $reason);
    switch ($arr[0]) {
        case 'deposit':
            $str = $L['charge_reason_deposit'];
            break;
        case 'credit':
            $str = $L['charge_reason_credit'];
            break;
        case 'vip':
            $str = $L['charge_reason_vip'];
            break;
        case 'pay':
            if (is_numeric($arr[1]) && is_numeric($arr[2])) {
                $t = $db->get_one("SELECT title FROM " . get_table(intval($arr[1])) . " WHERE itemid=" . intval($arr[2]));
                if ($t) {
                    $str = $t['title'];
                }
            }
            break;
        case 'trade':
            if (is_numeric($arr[1])) {
                $t = $db->get_one("SELECT title FROM " . $db->pre . "mall_order WHERE itemid=" . intval($arr[1]));
                if ($t) {
                    $str = $t['title'];
                }
            }
            break;
        case 'trades':
            $ids = explode(',', $arr[1]);
            $t = $db->get_one("SELECT title FROM " . $db->pre . "group_order WHERE itemid=" . intval($ids[0]));
            if ($t) {
                $str = $L['charge_reason_muti'] . $t['title'] . '...';
            }
            break;
        case 'group':
            if (is_numeric($arr[1])) {
                $t = $db->get_one("SELECT title FROM " . $db->pre . "group_order WHERE itemid=" . intval($arr[1]));
                if ($t) {
                    $str = $t['title'];
                }
            }
            break;
        default:
            break;
    }
    return $str;
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:51,代码来源:charge.inc.php

示例15: check_dunning

 private function check_dunning($bdname, $time, $status)
 {
     $sql = "select * from " . get_table($bdname) . " where etime >=now() and etime <='" . $time . "' and emailstatus<>" . $status;
     $rs = $this->mDb->getall($sql);
     foreach ($rs as $key => $value) {
         $r = $this->getRow("customers", $value["uid"]);
         $rs[$key]["email"] = $r["email"];
         if ($value["emailstatus"] == $status - 1) {
             if ($this->to_email($rs[$key]["email"], $status, $bdname)) {
                 $this->Update($bdname, $value["id"], " emailstatus =" . $status);
             }
         }
     }
 }
开发者ID:hetykai,项目名称:feidaoyu,代码行数:14,代码来源:dunning.class.php


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