// Because there is no mysql update syntax for multiple updates in one query
// we use a multiple insert syntax which will fail because the key already exist
// and then update the display_tel
// Because there is no mysql update syntax for multiple updates in one query
// we use a multiple insert syntax which will fail because the key already exist
// and then update the display_tel
- XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id ,tel_type,
+ XDB::execute("INSERT INTO profile_phones (pid, link_type, link_id, tel_id ,tel_type,
search_tel, display_tel, pub, comment)
VALUES " . $values . "
ON DUPLICATE KEY UPDATE display_tel = VALUES(display_tel)");
search_tel, display_tel, pub, comment)
VALUES " . $values . "
ON DUPLICATE KEY UPDATE display_tel = VALUES(display_tel)");
- $res = XDB::iterator("SELECT uid, link_type, link_id, tel_id, tel_type, search_tel,
+ $res = XDB::iterator("SELECT pid, link_type, link_id, tel_id, tel_type, search_tel,
display_tel, pub, comment
FROM profile_phones
WHERE search_tel LIKE {?} AND display_tel NOT REGEXP {?}",
display_tel, pub, comment
FROM profile_phones
WHERE search_tel LIKE {?} AND display_tel NOT REGEXP {?}",
- $disp = format_display_number($phone['search_tel'], $error, array('format' => $format, 'phoneprf' => $prefix));
+ $phone = new Phone(array('display' => $phone['display_tel']));
+ $phone->format(array('format' => $format, 'phoneprf' => $prefix));
. "', '" . addslashes($phone['link_id'])
. "', '" . addslashes($phone['tel_id']) . "', '" . addslashes($phone['tel_type'])
. "', '" . addslashes($phone['link_id'])
. "', '" . addslashes($phone['tel_id']) . "', '" . addslashes($phone['tel_type'])