The procedure add_customer on the coffee site simply adds a new customer to the table without checking if the current customer isn't already in the database. Is there a way to prevent duplicate customer records and how would the code change
for example
if (mysqli_num_rows($r) == 0) { call add_customer}
if (mysqli_num_rows($r) == 1) { //thus the customer is in database and cannot be added again use information in database}