how to get sum of product price column with referance to other table column customer_id
<p>I want to get the <code>SUM</code> of product prices of a particular customer whose <code>id</code> and cart products I saved in the <code>cart</code> table. Prices are in the <code>products</code> table. </p>

<p>The table structures are as follows:  </p>

<pre><code>CART TABLE cart_id, customer_id, product_id, product_qty PRODUCTS TABLE product_id, product_cat, product_title, product_desc, product_price, product_img
</code></pre>

<p>How can I do that? I'm using the following <code>mysqli</code> and <code>php</code> code, but it returns  <code>NUll</code>:  </p>

<pre><code>"SELECT SUM(`product_price`) as total FROM products
INNER JOIN cart ON products.product_price = cart.customer_id
WHERE customer_id = '$c_id'";

$result = mysqli_query($conn, $sql);
</code></pre>