HI all,
I have a online shopping cart that I made myself,
I am wanting to SELECT all from my transactions to perform such accounting functions as “Sales by customer”
This is what I have so far (rough version):
<?php include "DB_connect"; $myConnection= mysqli_connect("$db_host","$db_username","$db_pass", "$db_name") or die ("could not connect to mysql"); $query = "SELECT * FROM transactions ORDER BY mc_gross DESC"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $payer_email=$row['payer_email']; $mc_gross=$row['mc_gross']; echo $payer_email; echo " "; echo $mc_gross; echo ""; } ?>
This is great but it doesn’t tell me how many time the person has shopped so I need a way of finding this out, any ideas?
Should give something like:
Payer email Amount Spent total trans
[email protected] £50 3