SQL क्वेरी बहुत सरल है और यह निम्नानुसार है
SELECT *, TIMESTAMPDIFF(day, Date, NOW()) FROM `your_table_name` WHERE TIMESTAMPDIFF(day, Date, NOW()) = 1;
अब आपको परिणाम की सामग्री प्राप्त करनी है और उन्हें एक स्ट्रिंग में रखना है
<?php
$sql = " SELECT *, TIMESTAMPDIFF(day, Date, NOW()) FROM `your_table_name` WHERE TIMESTAMPDIFF(day, Date, NOW()) = 1";
$query = mysql_query($query);
$emailBody = "";
while($row = mysql_fetch_assoc($query))
{
$emailBody .= "Name: ".$row['Name']."; Address: ".$row['Address']."; Data: ".$row['Data']."; Email: ".$row['email']." \n";
}
mail("[email protected]", "Subject", $emailBody);
?>
आनंद लें!