Search the Community
Showing results for tags 'add_customer'.
-
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}
- 3 replies
-
- procedures
- add_customer
-
(and 1 more)
Tagged with:
-
On the Shipping Information page, when a phone number is provided that has an area code greater than "214", after the "continue on to billing" button is clicked, the following error results: "An error occurred in script 'C:\wamp64\www\effortlessECommerce\effortless_ecommerce_2nd\ex2\html\checkout.php' on line 158: Your order could not be processed due to a system error." This is because the add_customer stored procedure's "p" (aka "phone") parameter is stored as an "int", and ints have a maximum value of 2,147,483,647. Therefore, a phone number with an area code larger than 214 will fail. I fixed the error like this: 1) Go to PHPMyAdmin. 2) Click "Procedures" 3) Click the "edit" button next to "add_customer" 4) Scroll down to the second to last row and change parameter "p" from an "int" to a "char". 5) Change parameter "p"'s "length/values" field from blank to "10" (no quote marks). 6) Click "Go" button. Now it "works on my machine".
- 2 replies
-
- stored procedure
- add_customer
- (and 5 more)