Answer the question
In order to leave comments, you need to log in
What is the best way to interact with classes and database?
I am making a game portal and I have some questions in order to organize the work with games as conveniently and correctly as possible.
That is, for example, we have several games, and I need to organize the following things:
- creating an application for the game
- game statistics
- and so on.
So the first thing I did was a general table of all games.
'game_id' => 'int(11) unsigned NOT NULL AUTO_INCREMENT',
'name' => 'varchar(200) NOT NULL',
'alias' => 'varchar(200) NOT NULL unique',
'logo' => 'varchar(200)',
'status' => 'tinyint(1) NOT NULL DEFAULT 0',
'sort' => 'tinyint(4) NOT NULL DEFAULT 0',
'description' => 'text',
'rules' => 'text',
'category' => 'int(11) unsigned DEFAULT 0',
'count_players_in_game' => 'int(11) NOT NULL DEFAULT 0',
'count_players_play' => 'int(11) NOT NULL DEFAULT 0',
'count_players_waiting' => 'int(11) NOT NULL DEFAULT 0',
'proposal_id' int(11) unsigned NOT NULL AUTO_INCREMENT,
'game_id' int(11) unsigned NOT NULL DEFAULT '0',
'date_start' datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
'date_end' datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
'status' tinyint(1) NOT NULL DEFAULT '0',
'money' tinyint(1) NOT NULL DEFAULT '0',
'bank' decimal(12,5) NOT NULL DEFAULT '0.00000',
'rules' text NOT NULL,
'hash' varchar(100) DEFAULT NULL,
'token' varchar(64) NOT NULL,
'waiting_id' int(11) unsigned NOT NULL AUTO_INCREMENT,
'proposal_id' int(11) unsigned NOT NULL,
'user_id' int(11) unsigned NOT NULL,
'sort' tinyint(1) NOT NULL DEFAULT '0',
'root' tinyint(1) NOT NULL DEFAULT '0',
'hash' varchar(100) DEFAULT NULL,
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question