Mount Sutro: An Electronic Periodical

620042024
0836Hours EDT

Random Fixation

by Archived Article (2001–2014) Help
Just a quick warning: This post will be a little technical and probably boring to most, but I am pleased with my accomplishment and wanted to share.

If I set out on a mission, I will not generally quit until I have completed the mission successfully. This is especially true when it comes to internet and programming matters. I am not a programmer by trade, but have learned a lot about the server-side scripting language Hypertext Preprocessor (PHP). For readers in the dark already, PHP allows simple and advanced programming operations to be completed on the server before the page is served to the viewer. The benefit of this is one need not worry about browsers inappropriately interpreting your code and making things look undesirable.

Many operations on this site and others I have produced use both simplistic and more advanced scripts, generally based upon something I have found online and adapted for my use. A few were written specifically for me by a few very generous people whom are often the ones helping me learn as we go along.

I decided tonight during an unusual television-watching session that I wanted to reconstruct the operation of the "Random Fixation" "Media Library" window, which randomly displays musical works I own and enjoy. As it stood previously, the HTML code needed to generate the information was placed into an array that randomly displayed each time the page was loaded or refreshed. A very simple randomisation script was modified and used for this purpose. However, adding new entries was a cumbersome task, requiring lots of scrolling and copy/paste actions. The immediate solution was apparent: I needed to build a MySQL database and use it as a back-end to serve the data to the randomiser.

PHP programmers, this is your cue to begin laughing. Hysterically. I am sure there were much easier, more proper and cleaner ways to accomplish this feat, but after five hours of coding, testing and failing, I figured out how to do all this. I did not even ask one person for assistance, for which I am particularly proud. My next addendum to this project will be modifying the script to allow people to view all of the selections (thirty-four at the time of this writing) at once. Nevertheless, that will have to wait until I stop seeing PHP code when I close my eyes.

So if the site suddenly catches fire or vomits a spew of error messages your way, chance may be that I managed to bollocks up the works. Should that be the case, please let me know!

Two Comment Bubbles One Comment

  • Maurice

    I'm one of those who understands what you're talking about, about I wouldn't laugh about it taking you five hours to figure out what you did. I operate the same way; I turn for help only when I know I'm completely wasting my time. At any rate, should Mount Sutro exploded without you noticing, we'll be sure to tell you. :-)

Closed Comment Bubble Comments Closed

  • Article comments are disabled after ninety days. Alternatively, you can send feedback via email.