Welcome Guest, Not a member yet? Register   Sign In
What would be a more efficient way to display data from a database
#1

How's it going CodeIgniter 4 Dev's

 A little back story, I'm programming a website for our local High Schools Wrestling Team. The site will allow for users to see the wrestling schedule for the current season; and the coaches will be able to make changes to the data from the control panel page I programmed. There's a lot of data stored in the database. The database has a lot of tables. I personally don't think I'm being efficient when building out the database tables. I have created a table for each section of the schedule. For example, league, valley, area, masters, state etc... should I only create one table to manage each section of the wrestling schedule or should I continue on with what I'm doing? My controller is bloated with each section of the table that would allow for CRUD functionality.
 
This little site that I was trying to build, is a lot bigger than I thought it would be.
Reply
#2

You would need to show us your tables for us to see what you have done and to help you.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

It's a long read but probably helpful:

https://www.essentialsql.com/database-normalization/
Reply
#4

Thank you @InsiteFX, I'll post my Table information below. I also wanted to add a SuperAdmin that would give the head coach the ability to control what coaches are allowed to have an account on the site. I think Shield would be great for that functionality. This will also be my first time programming functionality like this so I'm excited about this build.

Table overview

Code:
Table        Action                                    Rows Type   Collation          Size      Overhead
area         Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -
league       Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -
mastersboys  Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -
mastersgirls Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -
register     Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -
rosterboys   Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -
rostergirls  Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -
schedule     Browse Structure Search Insert Empty Drop 3    InnoDB utf8mb4_general_ci 16.0 KiB  -
state        Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -
valley       Browse Structure Search Insert Empty Drop 1    InnoDB utf8mb4_general_ci 16.0 KiB  -

10 tables    Sum                                       12   InnoDB utf8mb4_general_ci 160.0 KiB 0 B


Table Structure

Code:
# Name       Type         Collation          Null Default          Extra          Action
1 id         int(11)                         No   None             AUTO_INCREMENT Change Drop More
2 date       varchar(50)  utf8mb4_general_ci No   None                            Change Drop More
3 day        varchar(50)  utf8mb4_general_ci No   None                            Change Drop More
4 opponent   varchar(190) utf8mb4_general_ci No   None                            Change Drop More
5 location   varchar(190) utf8mb4_general_ci No   None                            Change Drop More
6 time       varchar(50)  utf8mb4_general_ci No   None                            Change Drop More
7 created_at datetime                        No   current_timestamp()             Change Drop More
Reply
#5

if any table columns match with another table try using a type that could differentiate data.
Learning Codeigniter 
Reply
#6

If your tables have related information like mastsboys and mastersgirls and rosterboys and rostergirls
seems that you would be repeating information in these tables, then you should be able to combined
them into one, add a field called gender etc.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB