Joomla Array - 数据库

How to set up an array so that instead of maximum - an array on multiples of 30 is shown

i.e $max = 30, 60, 90, 120, 150......and so on

If array $max matches on multiple of 30, 60, 90, 120, 150, 180, 210..... then it should display message that limits are exhausted.

// Define the maximum Submissions
$max = 30;

// Get the current logged in user.
$user = JFactory::getUser();

// Get a database connection.
$db   = JFactory::getDbo();
$query   = $db->getQuery(true);

// Setup the query.
$query->select('COUNT('.$db->qn('Username').')')
    ->from($db->qn('#__rsform_submissions'))
    ->where($db->qn('Username').'='.$db->q($user->get('username')));

$db->setQuery($query);
$counter = $db->loadResult();

if ($counter = $max){
  $formLayout = '<p style="color:blue;">Your Limits are Exhausted </p>';
}