$database = JFactory::getDbo();

$query = $database->getQuery(true);

// delete all custom keys for user 1001.
$conditions = array(
    $database->quoteName('user_id') . ' = 22', 
    $database->quoteName('profile_key') . ' = ' . $database->quote('custom.%')
);

$query->delete($database->quoteName('#__user_profiles'));
$query->where($conditions);

$database->setQuery($query);

$result = $database->execute();
Your Answer
Sign In
Enter email and password to comment or answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.