Support Tickets - CMS - Plugin Blog - frontend

CMS - Plugin Blog - frontend

CMS 07.06.2017 2279 Feedback Status: Open Solution: No bluesatkv


Bad count

$resultgt = $jakdb->query('SELECT COUNT(*) as totalAll FROM ' . $jaktable . ' WHERE ((startdate = 0 OR startdate <= ' . time() . ') AND (enddate = 0 || enddate >= ' . time() . ')) AND catid IN(' . smartsql($page2) . ') AND active = 1');
$getTotal = $resultgt->fetch_assoc();

This value isn't good because article can more ona category :-)

smartsql($page2)

Replies (2)

  • avatar bluesatkv

    Solution

    $resultgt = $jakdb->query('SELECT COUNT(*) as totalAll FROM ' . $jaktable . ' WHERE ((startdate = 0 OR startdate <= ' . time() . ') AND (enddate = 0 || enddate >= ' . time() . ')) AND catid LIKE "%' . smartsql($page2) . '%" AND active = 1');

    Works perfect. If I want to see all article in category :-)

    07.06.2017 0
  • avatar Jerome

    Thank you for your input.

    07.06.2017 0