本文整理汇总了PHP中M::update方法的典型用法代码示例。如果您正苦于以下问题:PHP M::update方法的具体用法?PHP M::update怎么用?PHP M::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类M
的用法示例。
在下文中一共展示了M::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: writeinto
function writeinto($info)
{
$infoarr = json_decode($info, true);
$flag = new M('flag');
$count = $flag->find("openid='" . $infoarr['openid'] . "'", '*', 'count');
$sqlarr = array("nickname" => bin2hex($infoarr['nickname']), "avatar" => $infoarr['headimgurl'], "fakeid" => randStr(), "sex" => $infoarr['sex'], "fromtype" => 'weixin', "datetime" => time(), "flag" => "2");
if (isset($infoarr['shadyphone'])) {
$shady = new M('cj_shady');
$shadyarr = $shady->find("phone=" . $infoarr['shadyphone']);
if (empty($shadyarr)) {
$addarr = array('phone' => $infoarr['shadyphone'], 'shady' => $shadyarr['grade']);
$sqlarr = array_merge($sqlarr, $addarr);
}
}
if ($count) {
$savve = $flag->update("openid='" . $infoarr['openid'] . "'", $sqlarr);
}
if ($savve) {
echo "ok";
}
}
示例2: set_weibo_conf
function set_weibo_conf()
{
if (empty($_POST['folllow'])) {
$_POST['folllow'] = 0;
}
if (empty($_POST['mention'])) {
$_POST['mention'] = 0;
}
if (empty($_POST['letter'])) {
$_POST['letter'] = 0;
}
if (!empty($_FILES['erweima']['type'])) {
//上传的文件
include 'updata.php';
$erweifile = updateimg($_FILES['erweima'], 'weibo-ma');
$_POST['erweima'] = $erweifile;
}
file_get_contents("http://xbsslcurl.sinaapp.com/weiboapi/chengxml.php?token=" . $_POST['access_token']);
$weixin_configc = new M('weibo_config');
$save = $weixin_configc->update('id=1', $_POST);
echo "<script>alert('微博墙已经配置成功!');history.go(-1);</script>";
}