title: show sum result group by date mysqli
body: <p>I have an issue by showing wrong result when I need to show a table with a total price ORDER BY order_date</p>
  
  <p>I have a database with:</p>
  
  <pre><code>- order_id
  - order_date
  - order_price
  - order_quantity
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>$sql = mysqli_query($con,"SELECT *, 
                                   SUM(order_q) * SUM(order_price) as total 
                            FROM o_orders_f 
                            GROUP BY order_id");
  </code></pre>
  
  <p>but this code will sum all results and give me wrong answer</p>
  
  <pre><code>$sql = mysqli_query($con, "SELECT *, 
                                    SUM(order_quantity) * SUM(order_price) as total 
                             FROM o_orders_f 
                             GROUP BY order_id");
  while ($r = mysqli_fetch_array($sql)) {
     $date = $r['order_date'];
     $total = $r['total'];
     echo $total;     
  }
  </code></pre>
  
  <p>the result I'm looking for is like this:</p>
  
  <pre><code>7 Jul, 2019 - total: ($r['quantity']* $r['price']) = 72933 
  8 Jul, 2019 - total: ($r['quantity']* $r['price']) = 453
  9 Jul, 2019 - total: ($r['quantity']* $r['price']) = 72
  </code></pre>