dongtaihui5131 2015-07-29 12:49
浏览 35

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>';
}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料