title: How to put current date in to my SQL datediff
body: <p>This is a query which I tried below.</p>
  
  <pre><code>$sql = "SELECT id,due, datediff(date('Y/m/d'), date)  FROM sales
  </code></pre>
  
  <p>I am writing a sales program for identifying the due payment.
  If the due payment is more than 7 error displayed payment pending what I tried so far I attached below of the full coding. when I tried the below code error ouput displayed</p>
  
  <blockquote>
    <p>Notice: Undefined index: datediff(pay_date, date)</p>
  </blockquote>
  
  <pre><code>if ($_SERVER['REQUEST_METHOD'] == 'GET') {
      $today = date("Y/m/d");
      $sql = "SELECT id,due, datediff(date('Y/m/d'), date)  FROM sales where due != '0' ";
      $result = $conn-&gt;query($sql);
      if ($result-&gt;num_rows &gt; 0) {
          while ($row = $result-&gt;fetch_assoc()) {
              $id = $row['id'];
              $paydate = $row["datediff(pay_date, date)"] . " " .  "Days" . "&lt;/br&gt;";
              if ($paydate &gt;= 7) {
                  $status = "Payment pending";
                  $color = "#47f50b";
              } elseif ($paydate &gt;= 3) {
                  $status = "Payment pending please settle down the amount";
                  $color = "yellow";
              } elseif ($paydate &gt;= 1) {
                  $status = "kindly pay the payment";
                  $color = "#00a8ff";
              } elseif ($paydate == 0) {
                  $status = "Disable your Order";
                  $color = "red";
              }
          ?&gt;
  </code></pre>