Database of baseball statistics that are viewed via DataTables using SQL, jQuery, JavaScript, JSON, AJAX, and PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.idea
js-datatable
wp-admin
wp-content
wp-includes
.DS_Store
.htaccess
Baseball_Stats_Batting.sql
Baseball_Stats_BattingPost.sql
Baseball_Stats_HallOfFame.sql
Baseball_Stats_Managers.sql
Baseball_Stats_Master.sql
Baseball_Stats_Parks.sql
Baseball_Stats_Pitching.sql
Baseball_Stats_PitchingPost.sql
Baseball_Stats_Salaries.sql
Baseball_Stats_SeriesPost.sql
Baseball_Stats_Teams.sql
Baseball_Stats_TeamsFranchises.sql
Baseball_Stats_battingview.sql
Baseball_Stats_hof.sql
Baseball_Stats_newBatting.sql
Baseball_Stats_newBattingPost.sql
Baseball_Stats_newManagers.sql
Baseball_Stats_newPitching.sql
Baseball_Stats_newPitchingPost.sql
Baseball_Stats_newSalaries.sql
Baseball_Stats_newTeams.sql
Baseball_Stats_pitchingview.sql
Baseball_Stats_playerInfo.sql
README.md
batting.php
battingPost.php
config.php
dataTablesMain.css
dataTablesMain.js
hof.php
index.php
jqsort.js
jquery.js
license.txt
mainTable.html
managers.php
pitching.php
pitchingPost.php
playerInfo.php
queries.php
salaries.php
serverside.php
serverside2.php
ssp.class.php
ssp.customized.class.php
ssp.php
table.html
teams.php
tsconfig.json
wp-activate.php
wp-blog-header.php
wp-comments-post.php
wp-config-sample.php
wp-config.php
wp-cron.php
wp-links-opml.php
wp-load.php
wp-login.php
wp-mail.php
wp-settings.php
wp-signup.php
wp-trackback.php
xmlrpc.php

README.md

Baseball-Stats

By: Caleb Bass --->> For: CS 4573 - Special Topics in Computing --->> Fall 2017

Link to the website supplementing the project: http://www.baseballauthorityhq.com/

Direct link to the page showing the tables: http://www.baseballauthorityhq.com/table.html

Database of baseball statistics that are injected into datatables using SQL, jQuery, JavaScript, JSON, AJAX, and PHP

Starting off on this project, I wanted to build upon what we learned in the Intro to Databases class by utilizing the database with an actual website. My goal was to put together a large database and then pull the data into a Wordpress site, so I created a website with some "dummy" content to go along of with the theme.

The easiest part of the whole process was definitely the database. I've become pretty comfortable with SQL, and using DataGrip to build everything was pretty straightforward. I did have to edit some of the data, as there was simply so many attributes per table that it was ridiculous, but that's baseball for you, it's a statistician's dream. The raw data I used came from Lahman's archives, which is one of the most comprehensive repositories on the sport.

After getting all the tables and data in order, I then set up a local server using MAMP and started trying to find a way to display the data in a pleasing and useful way. At first, I foolishly started to hard code each table's column headers and all into their own webpages, but I soon discovered there was a much better way to go about it.

Using jQuery and the wonderful DataTables plugin, I was able to make searchable and sortable tables dynamically. Adding to the dynamic ability, I used AJAX and server side processing to make it so the page never has to be reloaded when switching between tables. Selecting a different table from the dropdown simply destroys and redraws a new table in the specified HTML div.

Along the way, I discovered that in order to get all of the proper attribute column heading for the tables, and generally processing data, that JSON would be very useful. The simple structure made it easier to pass data around than it would have been otherwise.

Far and away the most difficult part of the whole process has been getting what I created locally to work on an actual website. Getting all the directories, connections, and all the other little details right so the files can be properly used has been a struggle at times. Writing up the code and previewing what it it does/looks like is the easier part, while taking the working pieces and putting them in the correct places so they can truly be utilizied is the hard part.