Sarcastic 8-ball update: Database fun

Hi all, and happy Friday! We wanted to share the progress we’ve made on our Sarcastic 8-ball project.

Instead of fixed responses in a Javascript loop, I decided to go with a MySQL database link and use some PHP functions to interact with it.

An added benefit is that now users have the ability to add their own responses to the database and the additions will be included in the randomized selection of an “answer” by the 8-ball.

Their questions will also be saved and displayed on the main page, with a sarcastic confirmation message displayed with the “answer” – check it out!

We added a “sarcasm level” slider which affects the SQL query.

Maximum sarcasm is of course encouraged.

Sarcastic 8-ball screenshot

Check it out on our server at https://www.redub.io/8ball

As always, a how-to is in the works, so stay tuned!

Leave a Reply

Your email address will not be published. Required fields are marked *