tested database query out a little bit. Need to add prepared statements or something. Probably want to change return type of query from mysqli_result to something more generic?