dates
Posted: Wed Dec 10, 2003 9:40 am
at the moment i am selecting by day,month and year using drop down lists, the query is
how do i get it to search by month and year only? I have tried a few things and can't get it to work.
?>
Code: Select all
<?php
$adate = ''.$_POST['yearstart'].'-'.$_POST['monthstart'].'-'.$_POST['daystart'].'';
$aorders = "SELECT orderno,username,DATE_FORMAT(dateadded, '%d-%m-%Y') AS dateadded,status FROM orders WHERE dateadded='$adate' AND archive='1' ORDER BY dateadded DESC";
$aordersq = mysql_query($aorders, $db_conn) or die("Query orders failed".mysql_error());
?>?>