本文整理汇总了PHP中UserInfo::userinfo_update方法的典型用法代码示例。如果您正苦于以下问题:PHP UserInfo::userinfo_update方法的具体用法?PHP UserInfo::userinfo_update怎么用?PHP UserInfo::userinfo_update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::userinfo_update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: upAddress
function upAddress($data = array(), $uid, $isParent = 0, $isMum = 1)
{
//$condition = '`childID`='.$uid;
$se_uid = array('uid' => $uid);
$arr = array('childID' => $uid, 'isMum' => $isMum);
//$p = ($isMum = 1 ? "母":"父");
if (!$isParent) {
if (mysql_fetch_array(UserInfo::userinfo_select($se_uid, 1))) {
$condition = '`uid`=' . $uid;
$re = UserInfo::userinfo_update($data, $condition);
if ($re) {
return mysql_fetch_array(UserInfo::userinfo_select($se_uid, 1), MYSQL_ASSOC);
} else {
return 400;
}
} else {
return 400;
}
} else {
if (ParentInfo::parentinfo_select_affect($arr, 1)) {
$data['childID'] = $uid;
$data['isMum'] = $isMum;
$condition = '`childID`=' . $uid . ' AND `isMum`=' . $isMum;
$re = ParentInfo::parentinfo_update($data, $condition);
if ($re) {
return mysql_fetch_array(ParentInfo::parentinfo_select($arr, 1), MYSQL_ASSOC);
} else {
return 400;
}
} else {
$data['childID'] = $uid;
$data['isMum'] = $isMum;
$re = ParentInfo::parentinfo_insert($data);
if ($re) {
return mysql_fetch_array(ParentInfo::parentinfo_select($arr, 1), MYSQL_ASSOC);
} else {
return 400;
}
}
}
}
示例2: isset
$re_select = $setUser->userinfo_select($arr_select, 1);
//uid如果已经存在的用户,更新资料
if (mysql_fetch_row($re_select)) {
$arr['gender'] = isset($arr['gender']) ? $arr['gender'] : 0;
$arr['age'] = isset($arr['age']) ? $arr['age'] : 0;
$arr['idCard'] = isset($arr['idCard']) ? $arr['idCard'] : '';
$arr['realName'] = isset($arr['realName']) ? $arr['realName'] : '';
$arr['birthDate'] = isset($arr['birthDate']) ? $arr['birthDate'] : '';
$checkArr = array('uid' => $arr['uid']);
//更新个人信息
$r = $setUser->userinfo_select($checkArr, 1);
if (!mysql_fetch_assoc($r)) {
echo $res->show(407);
exit;
}
$re = $setUser->userinfo_update($arr, $condition);
if ($re == 1) {
echo $res->show(200, mysql_fetch_assoc($setUser->userinfo_select($arr_select, 1)));
} else {
echo $res->show(407);
}
exit;
}
//不存在的用户,新创建
if (isset($arr['token'])) {
//找回密码,要验证token
if (isset($arr['tel'])) {
$token = $arr['token'];
if (checkToken($arr['tel'], $token) == 200) {
unset($arr['token']);
$arr_select_tel = array('tel' => $arr['tel']);
示例3: updateUserInfo
function updateUserInfo($data, $condition)
{
$re = new UserInfo();
return mysql_fetch_row($re->userinfo_update($data, $condition));
}