Box scores and PHP code

With bubbling excitement to populate his Basketball Highlights page with realistic content, Joaquin found a web form to create box score HTML tables for his posts. He filled the form to create two of these tables, and dumped—I mean, published—the long blocks of “dirty” code in his posts. I couldn’t take it and told him that I’d code a clean HTML/CSS table for his box scores giving him the ability to “easily” enter inputs to it via PHP.

He accepted and got involved in the project helping code the basic HTML for his intended box score design and a few lines of PHP. Then I got to work, got him a PHP app for his iPad, and taught him how to enter data in the template I coded for him.

screenshot of a filled PHP template in Joaquin's app
This is the PHP page in which Joaquin enters box score inputs. Code is precise; he must be careful not to remove or change characters, otherwise it won’t render.

He begins with a game results table, one in which he has laid out the teams and the scores for each quarter and the full game. Then he enters each player’s 16 statistics in the PHP template making sure that the data is 100% consistent. That is, each player’s statistics (field goals, 3-pointers, and free throws) must add to his total points, and all player points must add to the final team score. The dynamic table I coded only calculates team totals, so Joaquin has to do all the math for a consistent table output, which he wants. Then he sends me his PHP code, I upload it, and since the iPad won’t let him see HTML source, I copy and send him back the rendered HTML which he then publishes on the post for the corresponding game along with game flow charts and other components.

screenshot of a boxscore in Joaquin's Basketball page
The final product

This is quite a process! It involves lots of thinking and mathematical calculations to create sixteen statistics for each of over 20 players consistently with the story of his game; dealing with his data wrapped in code; navigating the intricacies of our collaborative web publishing process; fixing errors when they happen… The work requires patience and careful attention to many details, and at the time I’m writing this (Sep, 2018) Joaquin has gone through this process for 11 of his pretend NBA games.

Share this post: Share on Facebook Share on Pinterest Share on LinkedIn Share on Google+ Share on Twitter

Portfolio Categories

Learning: all, , , , , , , , , , , , ,
Interests: all, , , , , , , , , , , , ,
Series: , ,