Tell us what’s happening:
Describe your issue in detail here.
After adding the if statement below the # if no rentals, the coderun doesn’t proceed to the next level. I tried resetting many times including the soft reset but still there is no response.
What should I do know to go to the next level because the run button also not responding too? It just turn white and back to blue.
I even delete the echo customer_rental but still nothing happens.
Your code so far
`RETURN_MENU() {
# get customer info
echo -e "\nWhat's your phone number?"
read PHONE_NUMBER
CUSTOMER_ID=$($PSQL "SELECT customer_id FROM customers WHERE phone = '$PHONE_NUMBER'")
echo "$CUSTOMER_RENTALS"
# if not found
if [[ -z $CUSTOMER_ID ]]
then
# send to main menu
MAIN_MENU "I could not find a record for that phone number."
else
# get customer's rentals
CUSTOMER_RENTALS=$($PSQL "SELECT bike_id, type, size FROM bikes INNER JOIN rentals USING(bike_id) INNER JOIN customers USING(customer_id) WHERE phone = '$PHONE_NUMBER' AND date_returned IS NULL ORDER BY bike_id")
# if no rentals
if [[ -z $CUSTOMER_RENTALS ]]
then
# send to main menu
fi
}
EXIT() {
echo -e "\nThank you for stopping in.\n"
}
MAIN_MENU
`
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36 OPR/95.0.0.0
Challenge: Learn Bash and SQL by Building a Bike Rental Shop - Build a Bike Rental Shop
Link to the challenge: