if(isset($_POST['type'])){
$type=$_POST['type'];
if($type=='4'){
$month4=$_POST['month4'];
$year4=$_POST['year4'];
$date="/$month4/$year4";
$month5=$_POST['month5'];
$year5=$_POST['year5'];
$date="/$month5/$year5";
$topic="รายงานการสั่งซื้อระหว่าง เดือน $month4 ปี $year4 ถึง เดือน $month5 ปี $year5 " ;
$sql="select *,STR_TO_DATE(date_data, '%d/%m/%Y' ) as d from datastore where date_data like '%$date' order by d ";
$sql = "SELECT *,STR_TO_DATE(date_data, '%d/%m/%Y' ) as d FROM datastore ";
$sql .= " WHERE MID(STR_TO_DATE(date_data, '%d/%m/%Y' ), 1, 7) BETWEEN '2013-01' AND '2013-02' ";
$sql = "SELECT *,STR_TO_DATE(date_data, '%d/%m/%Y' ) as d FROM datastore ";
$sql .= " WHERE MID(STR_TO_DATE(date_data, '%d/%m/%Y' ), 1, 7) BETWEEN '$date1' AND '$date2' ";