I found a tshirt designer on github and have been working on it. I managed to get the customer function to insert into the database but it does not post the order details into the database. I get this error :
Notice: Undefined variable: selectNumRows in G:\xampp\htdocs\tdesigner\php\send.php on line 73
Though when I check the code on line 73 and forth, I don't see any problems to it.
The function code:
/* Get the number of rows and current customer information */
if ($selectCurrentCustomer = $mysqli->prepare($querySelect)) {
/* Fetch the SELECT data */
$selectCurrentCustomer->execute();
$selectCurrentCustomer->bind_result($id);
$selectCurrentCustomer->store_result();
$selectCurrentCustomer->fetch();
/* Store the customer ID and number of rows found */
$selectNumRows = $selectCurrentCustomer->num_rows;
$customerId = (selectNumRows == 0) ? $id : null;
/* Close the query */
$selectCurrentCustomer->close();
}
/* If not a returning customer, insert them into the database. Otherwise, update the existing customer */
if ($selectNumRows == 0) { // LINE #73
I hope someone could help me on this. Thank you.