$database = JFactory::getDbo();

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

// Fields to update.
$fields = array(
    $database->quoteName('profile_value') . ' = ' . $database->quote('Updating custom message.'),
    $database->quoteName('ordering') . ' = 12'
);

// Conditions for which records should be updated.
$conditions = array(
    $database->quoteName('user_id') . ' = 22', 
    $database->quoteName('profile_key') . ' = ' . $database->quote('custom.message')
);

$query->update($database->quoteName('#__user_profiles'))->set($fields)->where($conditions);

$database->setQuery($query);

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