本文整理汇总了PHP中Addresses::count方法的典型用法代码示例。如果您正苦于以下问题:PHP Addresses::count方法的具体用法?PHP Addresses::count怎么用?PHP Addresses::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addresses
的用法示例。
在下文中一共展示了Addresses::count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateAddress
function updateAddress($addr, $keep_photo = true)
{
global $keep_history, $domain_id, $base_from_where, $table, $table_grp_adr, $table_groups;
$addresses = new Addresses($addr['id']);
$resultsnumber = $addresses->count();
$homepage = str_replace('http://', '', $addr['homepage']);
$is_valid = $resultsnumber > 0;
if ($is_valid) {
if ($keep_history) {
// Get current photo, if "$keep_photo"
if ($keep_photo) {
$r = $addresses->nextAddress()->getData();
$addr['photo'] = $r['photo'];
}
$sql = "UPDATE {$table}\r\n\t SET deprecated = now()\r\n\t\t WHERE deprecated is null\r\n\t\t AND id\t = '" . $addr['id'] . "'\r\n\t\t AND domain_id = '" . $domain_id . "';";
$result = mysql_query($sql);
saveAddress($addr);
} else {
$sql = "UPDATE {$table} SET firstname = '" . $addr['firstname'] . "'\r\n\t , lastname = '" . $addr['lastname'] . "'\r\n\t , nickname = '" . $addr['nickname'] . "'\r\n\t , company = '" . $addr['company'] . "'\r\n\t , title = '" . $addr['title'] . "'\r\n\t , address = '" . $addr['address'] . "'\r\n\t , home = '" . $addr['home'] . "'\r\n\t , mobile = '" . $addr['mobile'] . "'\r\n\t , work = '" . $addr['work'] . "'\r\n\t , fax = '" . $addr['fax'] . "'\r\n\t , email = '" . $addr['email'] . "'\r\n\t , email2 = '" . $addr['email2'] . "'\r\n\t , email3 = '" . $addr['email3'] . "'\r\n\t , homepage = '" . $addr['homepage'] . "'\r\n\t , aday = '" . $addr['aday'] . "'\r\n\t , amonth = '" . $addr['amonth'] . "'\r\n\t , ayear = '" . $addr['ayear'] . "'\r\n\t , bday = '" . $addr['bday'] . "'\r\n\t , bmonth = '" . $addr['bmonth'] . "'\r\n\t , byear = '" . $addr['byear'] . "'\r\n\t , address2 = '" . $addr['address2'] . "'\r\n\t , phone2 = '" . $addr['phone2'] . "'\r\n\t , notes = '" . $addr['notes'] . "'\r\n\t " . ($keep_photo ? "" : ", photo = '" . $addr['photo'] . "'") . "\r\n\t , modified = now()\r\n\t\t WHERE id = '" . $addr['id'] . "'\r\n\t\t AND domain_id = '{$domain_id}';";
$result = mysql_query($sql);
}
// header("Location: view?id=$id");
}
return $is_valid;
}