当前位置: 首页>>代码示例>>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;未经允许,请勿转载。