I am using below jQuery:
$rezultat = "SELECT sum(vrednost) as vrednost FROM vrednosti WHERE username = '$username' AND cas between '".date("Y-".(date("m")-1)."-01")."' AND '".date("Y-".(date("m")-1)."-31 23:59:59")."' ";
This works fine, where previous month is in the same year as current date.
But now I run into trouble, because can't echo december, which is different year (2015) than january (2016).
Is there any elegant solution?