Today or Current Date Birthday Date Retrieve From the Ms Access Database.Suppose Today Date is 03-08-2018. I passed value only Date and Month day = 03, Month = 08 and year is not Pass. So, I Retrieve Current day and month record.
Data Retrieve Query in PHP
File.This Query Run in Ms Access database is Successfully and fetch current date Record but In PHP
file Give Empty Data.
Passed data in url
just Like this: localhost/Bi.php?Chhaprabhatha&mon=8&day=3
Its Give Result Like This: Resource id #4{"status":0,"0":[]}
Query is Run in Database its give Result and Successfully run.In this code give null data
Bi.php
<?php
if(isset($_REQUEST["Chhaprabhatha"]))
{
include 'Connection.php';
$mon = $_GET['mon'];
$day = $_GET['day'];
$sql = "select std_name, regno,standard,division
FROM(select RegNo,b.Standard,c.Division,std_name,DOB as BirthDayDate,contactno1 as contact, Year(DOB) AS OrderYear, month(DOB) AS OrderMonth,Day(DOB) AS OrderDay,a.YearID,IsActive
from ((std_reg as a inner join standardmaster as b on a.standard = b.stdid)
inner join divisionmaster as c on a.division = c.divisionid)
) as t where (t.OrderMonth = $mon AND t.OrderDay = $day and t.Isactive = true)";
echo $stmt = odbc_exec($conn, $sql);
$result = [];
do {
while ($row = odbc_fetch_array($stmt)){
$result[] = $row;
}
} while (odbc_next_result($stmt));
if(count($result)>0)
{
$result1['status']=1;//"Login successfully";
echo array_push($result1,$result);
}
else
{
//$result[]="null";
$result1['status']=0;//"Record not found";
array_push($result1,$result);
}
odbc_free_result($stmt);
odbc_close($conn); //Close the connnectiokn first
echo json_encode($result1); //You will get the encoded array variable
}
?>