O'Reilly logo

MODx Web Development by Antano Solar John

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fortunes

Now that you have learned how to create snippets, let us create a snippet that displays a random fortune from the database. Fortunes are just quotations from famous texts. These are like a "quote of the day". They are called fortunes in the UNIX culture, after the introduction of the command-line program called fortune, many decades ago.

Creating the table

We will create a table that will hold the fortune and the author's name, using phpMyAdmin, to keep it simple. Most snippets that use a custom table will automatically create the table, if it doesn't exist already.

  1. Open phpMyAdmin. The URL for phpMyAdmin will be different depending on your method of installation. If you choose to install Apache and PHP individually, then you will have to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required