In This tutorial i will describe how to use
DateDiff() function of MySql.Date difference is very important function of MySql.Normally we will use server side script to operation of data,but based on performance its very costly,To avoid Server side script MySql provide Date difference function to get refined result from database.
Where date1 and date2 are valid date or date/time expressions.
Below script about how to get all result which is below 2 days from now.
$sql = “SELECT appToken.ExpiryDate,appToken.ApplicationId,app.Name,app.ApplicationSiteId FROM applicationtoken as appToken inner join application as app on app.ApplicationId =appToken.ApplicationId AND DATEDIFF(appToken.ExpiryDate,now()) <= 2"; $results = $this->dataObj->GetData($sql);
$isEmailSend = 1;