It seems to me that the posted code is simple enough not to need commenting, and that any parts not understood can be made clear by visits to the manual. I subscribe to the "Code Tells You How, Comments Tell You Why" principle, especially for a relatively high-level languange like PHP. "How" or "What" commenting, imo, quickly becomes signal noise. Again, I think the code pretty much documents itself, but if you have any "why" questions, please ask.
The MySQL "BETWEEN" function can be used like this:
$query = "SELECT * FROM my_table WHERE date_field BETWEEN '" . $from_date . "' AND '" . $to_date . "'";
The function compares data inclusively, that is it will return true if either $from_date or $to_date is equal to date_field ("between" is really a misnomer in this usage, but that's another matter). For an exclusive comparison use the "<" and ">" operators, as in my first reply.