Number Guessing Game

I am having trouble passing the last project in the Relational Database path, Number Guessing Game.
I am failing 2 tests:

If that username has been used before, it should print Welcome back, ! You have played <games_played> games, and your best game took <best_game> guesses., with being a users name from the database, <games_played> being the total number of games that user has played, and <best_game> being the fewest number of guesses it took that user to win the game

When the secret number is guessed, your script should print You guessed it in <number_of_guesses> tries. The secret number was <secret_number>. Nice job! and finish running

I am unsure why the tests are failing.
My code can be found here

If you run the create_database.sh script first to create the database, you can run the number_guss.sh script in the number_guessing_game folder.

Can anyone see why it is failing? It seems to me the feedback given to the user is exactly as suggested in the assignment.