當前位置: 首頁>>代碼示例>>PHP>>正文


PHP pdo_fieldexists函數代碼示例

本文整理匯總了PHP中pdo_fieldexists函數的典型用法代碼示例。如果您正苦於以下問題:PHP pdo_fieldexists函數的具體用法?PHP pdo_fieldexists怎麽用?PHP pdo_fieldexists使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了pdo_fieldexists函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: requreSubscribe

function requreSubscribe()
{
    global $_W;
    $hasSubscribe = 1;
    if (isset($_W['fans']['from_user']) && !empty($_W['fans']['from_user'])) {
        $openid = $_W['fans']['from_user'];
        $userinfo = mc_fansinfo($openid);
        if (!$userinfo || $userinfo['follow'] == 0) {
            $hasSubscribe = 0;
        }
    } else {
        $oauthAccount = $_W['oauth_account'];
        if (empty($oauthAccount)) {
            message('未指定網頁授權公眾號, 無法獲取用戶信息.', '', 'error');
        }
        $userinfo = mc_oauth_userinfo();
        $level = pdo_fetchcolumn("SELECT `level` FROM " . tablename('account_wechats') . " WHERE `uniacid`=:uniacid", array(':uniacid' => $_W['uniacid']));
        if ($level == 4) {
            if ($userinfo['subscribe'] == 0) {
                $hasSubscribe = 0;
            }
        } else {
            $unionid = isset($userinfo['unionid']) ? $userinfo['unionid'] : '';
            if (empty($unionid)) {
                message('獲取unionid失敗,請確認公眾號已接入微信開放平台', '', 'error');
            }
            $fieldsExist = pdo_fieldexists('mc_mapping_fans', 'unionid');
            if (!$fieldsExist) {
                pdo_query("ALTER TABLE " . tablename('mc_mapping_fans') . " ADD column unionid varchar(255) default null");
            }
            $openid = pdo_fetchcolumn("SELECT `openid` FROM " . tablename('mc_mapping_fans') . " WHERE `unionid`=:unionid AND `uniacid`=:uniacid ", array(':unionid' => $unionid, ':uniacid' => $_W['account']['uniacid']));
            if (empty($openid)) {
                $hasSubscribe = 0;
            } else {
                $userinfo = mc_fansinfo($openid);
                if (!$userinfo || $userinfo['follow'] == 0) {
                    $hasSubscribe = 0;
                }
            }
        }
    }
    return array('openid' => $openid, 'subscribe' => $hasSubscribe);
}
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:43,代碼來源:zqgame.inc.php

示例2: pdo_query

}
if (!pdo_fieldexists('weishare', 'background')) {
    pdo_query("ALTER TABLE " . tablename('weishare') . " ADD `background` varchar(100) NOT NULL COMMENT '背景顏色';");
}
if (!pdo_fieldexists('weishare', 'tip')) {
    pdo_query("ALTER TABLE " . tablename('weishare') . " ADD `tip` varchar(100) NOT NULL COMMENT '提示語';");
}
if (!pdo_fieldexists('weishare', 'copyright')) {
    pdo_query("ALTER TABLE " . tablename('weishare') . " ADD `copyright` varchar(100) NOT NULL COMMENT '版權' ;");
}
if (!pdo_fieldexists('weishare', 'cardname')) {
    pdo_query("ALTER TABLE " . tablename('weishare') . " ADD `cardname` varchar(100) NOT NULL COMMENT '卡片名稱' ;");
}
if (!pdo_fieldexists('weishare', 'unit')) {
    pdo_query("ALTER TABLE " . tablename('weishare') . " ADD `unit` varchar(100) NOT NULL COMMENT '單位' ;");
}
if (!pdo_fieldexists('weishare', 'helplimit')) {
    pdo_query("ALTER TABLE " . tablename('weishare') . " ADD `helplimit` int(11) NOT NULL  COMMENT '每天助力限製次數';");
}
if (!pdo_fieldexists('weishare', 'limittype')) {
    pdo_query("ALTER TABLE " . tablename('weishare') . " ADD `limittype` int(1) NOT NULL  COMMENT '限製類型' ;");
}
if (!pdo_fieldexists('weishare_firend', 'sid')) {
    pdo_query("ALTER TABLE " . tablename('weishare_firend') . " ADD `sid` int(10) NOT NULL DEFAULT '0' ;");
}
if (!pdo_fieldexists('weishare', 'endtime')) {
    pdo_query("ALTER TABLE " . tablename('weishare') . " ADD endtime\tint(11) unsigned NOT NULL COMMENT '日期' ;");
}
if (!pdo_fieldexists('weishare_setting', 'weid')) {
    pdo_query("ALTER TABLE " . tablename('weishare_setting') . " ADD weid INT(11) UNSIGNED DEFAULT NULL ;");
}
開發者ID:keycoolkui,項目名稱:weixinfenxiao,代碼行數:31,代碼來源:upgrade.php

示例3: implode

        }
    }
    $titles = implode("+", $titles);
    pdo_update("shopping_goods_option", array("title" => $titles), array("id" => $o['id']));
    pdo_update("shopping_order_goods", array("optionname" => $titles), array("optionid" => $o['id']));
}
//字段長度
if (pdo_fieldexists('shopping_goods', 'thumb')) {
    pdo_query("ALTER TABLE  " . tablename('shopping_goods') . " CHANGE `thumb` `thumb` varchar(255) DEFAULT '';");
}
if (!pdo_fieldexists('shopping_goods', 'spec')) {
    pdo_query("ALTER TABLE " . tablename('shopping_goods') . " ADD `spec` varchar(5000) NOT NULL DEFAULT '';");
}
if (!pdo_fieldexists('shopping_goods', 'originalprice')) {
    pdo_query("ALTER TABLE " . tablename('shopping_goods') . " ADD `originalprice` DECIMAL(10, 2) NOT NULL DEFAULT '0.00' COMMENT '原價' AFTER `costprice`;");
}
if (!pdo_fieldexists('shopping_order', 'paydetail')) {
    pdo_query("ALTER TABLE " . tablename('shopping_order') . " ADD  `paydetail` varchar(255) NOT NULL COMMENT '支付詳情';");
}
if (pdo_fieldexists('shopping_goods', 'total')) {
    pdo_query("ALTER TABLE  " . tablename('shopping_goods') . " CHANGE  `total`   `total` int(10) unsigned NOT NULL DEFAULT '0';");
}
if (pdo_fieldexists('shopping_goods', 'credit')) {
    pdo_query("ALTER TABLE  " . tablename('shopping_goods') . " CHANGE  `credit`  `credit` decimal(10,2) NOT NULL DEFAULT '0.00';");
}
if (!pdo_fieldexists('shopping_goods', 'usermaxbuy')) {
    pdo_query("ALTER TABLE " . tablename('shopping_goods') . " ADD   `usermaxbuy` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用戶最多購買數量';");
}
if (!pdo_fieldexists('shopping_order', 'address')) {
    pdo_query("ALTER TABLE " . tablename('shopping_order') . " ADD   `address` varchar(1024) NOT NULL DEFAULT '' COMMENT '收貨地址信息';");
}
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:31,代碼來源:upgrade.php

示例4: pdo_query

<?php

if (!pdo_fieldexists('egg_reply', 'periodlottery')) {
    pdo_query("ALTER TABLE `ims_egg_reply` ADD `periodlottery` SMALLINT( 10 ) UNSIGNED NOT NULL DEFAULT '1' COMMENT '0������';");
}
if (pdo_fieldexists('egg_award', 'activation_code')) {
    pdo_query("ALTER TABLE " . tablename('egg_award') . " CHANGE `activation_code` `activation_code` text;");
}
開發者ID:nsoff,項目名稱:wdlcms,代碼行數:8,代碼來源:upgrade.php

示例5: tablename

<?php

if (!pdo_fieldexists('wxwall_reply', 'logo')) {
    pdo_query("ALTER TABLE " . tablename('wxwall_reply') . " ADD `logo` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `isshow`;");
    pdo_query("ALTER TABLE " . tablename('wxwall_reply') . " ADD `background` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `logo`;");
}
開發者ID:alextiannus,項目名稱:wormwood_wechat,代碼行數:6,代碼來源:upgrade.php

示例6: tablename

<?php

/*
*/
if (!pdo_fieldexists('feng_wechat', 'win_mess')) {
    pdo_query("ALTER TABLE " . tablename('feng_wechat') . " ADD `win_mess` varchar(200) DEFAULT NULL;");
}
開發者ID:6662680,項目名稱:qday_wx,代碼行數:7,代碼來源:upgrade.php

示例7: tablename

<?php

/**
 */
if (!pdo_fieldexists('weihaom_wb_reply', 'uniacid')) {
    pdo_query("ALTER TABLE " . tablename('weihaom_wb_reply') . " ADD   `uniacid` int(10) unsigned NOT NULL;");
}
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:7,代碼來源:upgrade.php

示例8: pdo_delete

            pdo_delete('rule', "id IN ('" . implode("','", $deleteid) . "')");
        }
        $subaccount = pdo_fetchall("SELECT acid FROM " . tablename('account') . " WHERE uniacid = :uniacid", array(':uniacid' => $uniacid));
        if (!empty($subaccount)) {
            foreach ($subaccount as $account) {
                @unlink(IA_ROOT . '/attachment/qrcode_' . $account['acid'] . '.jpg');
                @unlink(IA_ROOT . '/attachment/headimg_' . $account['acid'] . '.jpg');
            }
        }
        $tables = pdo_fetchall("SHOW TABLES;");
        foreach ($tables as $table) {
            $tablename = str_replace($GLOBALS['_W']['config']['db']['tablepre'], '', array_shift($table));
            if (pdo_fieldexists($tablename, 'uniacid')) {
                pdo_delete($tablename, array('uniacid' => $uniacid));
            }
            if (pdo_fieldexists($tablename, 'weid')) {
                pdo_delete($tablename, array('weid' => $uniacid));
            }
        }
    }
    message('公眾帳號信息刪除成功!', url('account/batch'), 'success');
} elseif ($do == 'group') {
    if (!$_GPC['accountarr']) {
        message('您沒有選擇要操作的公眾號');
    }
    $isexpire = intval($_GPC['isexpire']);
    $endtime = strtotime($_GPC['endtime']);
    if ($isexpire && $endtime <= TIMESTAMP) {
        message('套餐過期時間必須大於當前時間');
    }
    $groupid = intval($_GPC['groupid']);
開發者ID:legeng,項目名稱:project-2,代碼行數:31,代碼來源:batch.ctrl.php

示例9: varchar

      `mediaid` varchar(255) DEFAULT \'\',
      `ticket` varchar(250) NOT NULL,
      `url` varchar(80) NOT NULL,
      `createtime` int(10) unsigned NOT NULL,
      `goodsid` int(11) DEFAULT \'0\',
      `qrimg` varchar(1000) DEFAULT \'\',
      PRIMARY KEY (`id`),
      KEY `idx_acid` (`acid`),
      KEY `idx_sceneid` (`sceneid`),
      KEY `idx_type` (`type`),
      FULLTEXT KEY `idx_openid` (`openid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;';
    $sql = 'CREATE TABLE  IF NOT EXISTS  ' . tablename('ewei_shop_poster_scan') . ' (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `uniacid` int(11) DEFAULT \'0\',
      `posterid` int(11) DEFAULT \'0\',
      `openid` varchar(255) DEFAULT \'\',
      `from_openid` varchar(255) DEFAULT \'\',
      `scantime` int(11) DEFAULT \'0\',
      PRIMARY KEY (`id`),
      KEY `idx_uniacid` (`uniacid`),
      KEY `idx_posterid` (`posterid`),
      KEY `idx_scantime` (`scantime`),
      FULLTEXT KEY `idx_openid` (`openid`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;';
    pdo_query($sql);
}
if (!pdo_fieldexists('ewei_shop_poster', 'paytype')) {
    pdo_query('ALTER TABLE ' . tablename('ewei_shop_poster') . ' ADD `paytype` tinyint(1) DEFAULT \'0\';');
}
pdo_update('ewei_shop_plugin', array('version' => 1.1), array('identity' => 'poster'));
開發者ID:noikiy,項目名稱:mygit,代碼行數:31,代碼來源:init.php

示例10: pdo_query

<?php

if (!pdo_fieldexists('wxwall_reply', 'logo')) {
    pdo_query("ALTER TABLE " . tablename('wxwall_reply') . " ADD `logo` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `isshow`;");
    pdo_query("ALTER TABLE " . tablename('wxwall_reply') . " ADD `background` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `logo`;");
    pdo_query("ALTER TABLE " . tablename('wxwall_reply') . " ADD `acid` INT NOT NULL AFTER `id`;");
}
if (!pdo_fieldexists('wxwall_members', 'avatar')) {
    pdo_query("ALTER TABLE " . tablename('wxwall_members') . " ADD  `avatar` varchar(255) NOT NULL COMMENT '粉絲頭像';");
}
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:10,代碼來源:upgrade.php

示例11: tablename

<?php

if (!pdo_fieldexists('ewei_dream_oversee', 'fansid')) {
    pdo_query("ALTER TABLE " . tablename('ewei_dream_oversee') . " ADD `fansid` int(11) NOT NULL DEFAULT '0';");
}
開發者ID:aspnmy,項目名稱:weizan,代碼行數:5,代碼來源:upgrade.php

示例12: pdo_query

}
if (!pdo_fieldexists('ewei_shop_goods', 'followurl')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_goods') . " ADD  `followurl` varchar(255) DEFAULT '0';");
}
if (!pdo_fieldexists('ewei_shop_goods', 'deduct')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_goods') . " ADD  `deduct` decimal(10,2) DEFAULT '0.00';");
}
if (!pdo_fieldexists('ewei_shop_member', 'agentselectgoods')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_member') . " ADD    `agentselectgoods` tinyint(3) DEFAULT '0';");
}
if (!pdo_fieldexists('ewei_shop_order', 'verifytime')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_order') . " ADD   `verifytime` int(11) DEFAULT '0';");
}
if (!pdo_fieldexists('ewei_shop_order', 'verifystoreid')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_order') . " ADD   `verifystoreid` int(11) DEFAULT '0';");
}
if (!pdo_fieldexists('ewei_shop_order', 'deductprice')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_order') . " ADD    `deductprice` decimal(10,2) DEFAULT '0.00';");
}
if (!pdo_fieldexists('ewei_shop_order', 'deductcredit')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_order') . " ADD    `deductcredit` int(11) DEFAULT '0';");
}
if (!pdo_fieldexists('ewei_shop_order', 'deductcredit2')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_order') . " ADD    `deductcredit2` decimal(10,2) DEFAULT '0.00';");
}
if (!pdo_fieldexists('ewei_shop_order', 'deductenough')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_order') . " ADD    `deductenough` decimal(10,2) DEFAULT '0.00';");
}
if (!pdo_fieldexists('ewei_shop_plugin', 'status')) {
    pdo_query("ALTER TABLE " . tablename('ewei_shop_plugin') . " ADD    `status` tinyint(3) DEFAULT '0';");
}
開發者ID:noikiy,項目名稱:mygit,代碼行數:31,代碼來源:upgrade.php

示例13: pdo_query

<?php

if (!pdo_fieldexists('research', 'pretotal')) {
    pdo_query("ALTER TABLE " . tablename('research') . " ADD `pretotal` INT( 10 ) UNSIGNED NOT NULL DEFAULT '1';");
}
//pdo_query("ALTER TABLE `ims_research` CHANGE `description` `description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '';");
if (!pdo_fieldexists('research', 'noticeemail')) {
    pdo_query("ALTER TABLE " . tablename('research') . " ADD `noticeemail` VARCHAR( 50 ) NOT NULL DEFAULT '';");
}
if (!pdo_fieldexists('research', 'endtime')) {
    pdo_query("ALTER TABLE " . tablename('research') . " ADD `endtime` INT( 10 ) UNSIGNED NOT NULL ;");
}
if (!pdo_fieldexists('research', 'content')) {
    pdo_query("ALTER TABLE " . tablename('research') . " CHANGE `description` `content` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;");
    pdo_query("ALTER TABLE " . tablename('research') . " ADD `description` VARCHAR( 1000 ) NOT NULL DEFAULT '' AFTER `title` ;");
}
if (!pdo_fieldexists('research', 'status')) {
    pdo_query("ALTER TABLE " . tablename('research') . " ADD `status` VARCHAR(1)  NULL DEFAULT '';");
}
開發者ID:alextiannus,項目名稱:wormwood_wechat,代碼行數:19,代碼來源:upgrade.php

示例14: pdo_query

}
if (!pdo_fieldexists('brand_reply', 'news_content')) {
    pdo_query("ALTER TABLE " . tablename('brand_reply') . " ADD `news_content` VARCHAR(500) NOT NULL;");
}
if (!pdo_fieldexists('brand', 'btnName')) {
    pdo_query("ALTER TABLE " . tablename('brand') . " ADD btnName VARCHAR(20) DEFAULT NUL ;");
}
if (!pdo_fieldexists('brand', 'btnUrl')) {
    pdo_query("ALTER TABLE " . tablename('brand') . " ADD btnUrl VARCHAR(100) DEFAULT NULL ;");
}
if (!pdo_fieldexists('brand', 'showMsg')) {
    pdo_query("ALTER TABLE " . tablename('brand') . " ADD showMsg INT(1) DEFAULT 0 ;");
}
if (!pdo_fieldexists('brand', 'btnName1')) {
    pdo_query("ALTER TABLE " . tablename('brand') . " ADD btnName1 VARCHAR(20) DEFAULT NULL ;");
}
if (!pdo_fieldexists('brand', 'btnUrl1')) {
    pdo_query("ALTER TABLE " . tablename('brand') . " ADD btnUrl1 VARCHAR(100) DEFAULT NULL ;");
}
if (!pdo_fieldexists('brand', 'btnName2')) {
    pdo_query("ALTER TABLE " . tablename('brand') . " ADD btnName2 VARCHAR(20) DEFAULT NULL ;");
}
if (!pdo_fieldexists('brand', 'btnUrl2')) {
    pdo_query("ALTER TABLE " . tablename('brand') . " ADD btnUrl2 VARCHAR(100) DEFAULT NULL ;");
}
if (!pdo_fieldexists('brand', 'intro2')) {
    pdo_query("ALTER TABLE " . tablename('brand') . " ADD intro2 VARCHAR(500) NOT NULL ;");
}
if (!pdo_fieldexists('brand_message', 'address')) {
    pdo_query("ALTER TABLE " . tablename('brand_message') . " ADD address VARCHAR(200) NOT NULL ;");
}
開發者ID:aspnmy,項目名稱:weizan,代碼行數:31,代碼來源:upgrade.php

示例15: pdo_query

 * DELIMITER //
 * CREATE PROCEDURE schema_add() BEGIN
 * DECLARE CurrentDatabase VARCHAR(100);
 * SELECT DATABASE() INTO CurrentDatabase;
 * IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=CurrentDatabase AND table_name = 'ims_users_profile' AND column_name = 'jd_account') THEN
 * ALTER TABLE `ims_users_profile` ADD `jd_account` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '無' COMMENT '京東賬號';
 * END IF;
 * IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=CurrentDatabase AND table_name = 'ims_mc_members' AND column_name = 'jd_account') THEN
 * ALTER TABLE `ims_mc_members` ADD `jd_account` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '無' COMMENT '京東賬號';
 * END IF;
 * IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema=CurrentDatabase AND table_name = 'ims_mc_members' AND column_name = 'modifytime') THEN
 * ALTER TABLE `ims_mc_members` ADD `modifytime` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改時間';
 * END IF;
 * END;//
 * DELIMITER ;
 * CALL schema_add();
 * INSERT INTO `ims_profile_fields`(field,available, title,description,displayorder,required,unchangeable,showinregister) SELECT 'jd_account', '1', '京東帳號', '', '0', '0', '0', '1' FROM DUAL WHERE NOT EXISTS(SELECT `field` FROM `ims_profile_fields` WHERE `field` = 'jd_account');"
 */
if (!pdo_fieldexists('users_profile', 'jd_account')) {
    pdo_query("ALTER TABLE " . table('users_profile') . " ADD `jd_account` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '無' COMMENT '京東賬號'");
}
if (!pdo_fieldexists('mc_members', 'jd_account')) {
    pdo_query("ALTER TABLE " . table('mc_members') . " ADD `jd_account` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '無' COMMENT '京東賬號'");
}
if (!pdo_fieldexists('mc_members', 'modifytime')) {
    pdo_query("ALTER TABLE " . table('mc_members') . " ADD `modifytime` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改時間'");
}
if (empty(pdo_fetch('SELECT field,title FROM ' . tablename('profile_fields') . ' WHERE field = :field', array(':field' => 'jd_account')))) {
    $data = array('field' => 'jd_account', 'available' => '1', 'title' => '京東帳號', 'description' => '', 'displayorder' => '0', 'required' => '0', 'unchangeable' => '0', 'showinregister' => '1');
    pdo_insert('profile_fields', $data);
}
開發者ID:dalinhuang,項目名稱:urWq,代碼行數:31,代碼來源:init.php


注:本文中的pdo_fieldexists函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。