select count(*) as cnt from nfor_campaign where cp_approve='1' and cp_step='4' and cp_use='1' and cp_sdatetime <= '2024-05-04 08:59:31' and DATE(cp_pick_datetime) >= DATE('2024-05-04 08:59:31') order by case when cp_recruit <= cp_asign_count then 1 else 0 end,

1064 : You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 4

error file : /campaign_list.php