how to echo currentdate in mysql query php
current month start
<?php echo date("Y-m-1");?>
current month end
<?php echo date("Y-m-31");?>
and this is mysql query
$result = mysql_query("SELECT * FROM fuel where monthdate BETWEEN 'current
month start' AND 'current month end' ORDER BY CAST(amount as SIGNED
INTEGER) DESC LIMIT 4");
how to echo this to
<?php echo date("Y-m-1");?>
<?php echo date("Y-m-31");?>
in this BETWEEN '{Y-m-1}' AND '{Y-m-31}'
please help me to fix this issue thanks
No comments:
Post a Comment