ihofmann / open-websoccer

A PHP based online football/soccer manager game.
GNU Lesser General Public License v3.0
107 stars 70 forks source link

Database Query Error: Field 'admin_id' #35

Open theMcKing opened 7 years ago

theMcKing commented 7 years ago

Hallo,

ich habe den Websoccer auf meinem Ubuntu Server installiert. Beim erstellen z.B. einer Liga im Admin-Bereich erhalte ich folgende Fehlermeldung: Database Query Error: Field 'admin_id' doesn't have a default value

Leider weiß ich nicht was dies bedeuten kann. Kann mir damit jemand helfen?

Falls ihr weitere Informationen braucht, stell ich diese euch gerne zur Verfügung.

Danke schonmal.

Informationen: PHP 5.6.30-10+deb.sury.org~xenial+2 (cli) MySQL: Version: 5.7.17-0ubuntu0.16.04.2

theMcKing commented 7 years ago

Hello,

I have the Websoccer installed on my Ubuntu server.

When creating e.g. a league in the admin area I get the following error message: DatabaseQueryError: Field 'admin_id' does not have a default value

Unfortunately, I don't know what this mean. Can someone help me?

If you need any further information, please do not hesitate to contact me.

Thanks in advance.

Information: PHP 5.6.30-10 + deb.sury.org ~ xenial + 2 (cli) MySQL: Version: 5.7.17-0ubuntu0.16.04.2

PierroK commented 7 years ago

Hi, How is your _liga table set up? Error message seems to indicate that there is no default value set for the field 'admin_id'.

Regards

theMcKing commented 7 years ago

Hi rogue94, i just install the mysql and phpmyadmin and create a new user "websoccer" with the database "websoccer" with all rights for this database, so i thin the _liga table is empty.

What i should do after the creating the user and database? As in the installation guide i can't find any information.

Regards

PierroK commented 7 years ago

Can you check the structure of your _liga table via phpmyadmin ?

theMcKing commented 7 years ago

smallint(5) Nein kein(e) AUTO_INCREMENT Bearbeiten Bearbeiten Löschen Löschen Mehr 2 name varchar(50) utf8_general_ci Ja NULL Bearbeiten Bearbeiten Löschen Löschen Mehr 3 kurz varchar(5) utf8_general_ci Ja NULL Bearbeiten Bearbeiten Löschen Löschen Mehr 4 land varchar(25) utf8_general_ci Ja NULL Bearbeiten Bearbeiten Löschen Löschen Mehr 5 p_steh tinyint(3) Nein kein(e) Bearbeiten Bearbeiten Löschen Löschen Mehr 6 p_sitz tinyint(3) Nein kein(e) Bearbeiten Bearbeiten Löschen Löschen Mehr 7 p_haupt_steh tinyint(3) Nein kein(e) Bearbeiten Bearbeiten Löschen Löschen Mehr 8 p_haupt_sitz tinyint(3) Nein kein(e) Bearbeiten Bearbeiten Löschen Löschen Mehr 9 p_vip tinyint(3) Nein kein(e) Bearbeiten Bearbeiten Löschen Löschen Mehr 10 preis_steh smallint(5) Nein kein(e) Bearbeiten Bearbeiten Löschen Löschen Mehr 11 preis_sitz smallint(5) Nein kein(e) Bearbeiten Bearbeiten Löschen Löschen Mehr 12 preis_vip smallint(5) Nein kein(e) Bearbeiten Bearbeiten Löschen Löschen Mehr 13 admin_id smallint(5) Nein

PierroK commented 7 years ago

Can you do a check of the sql_mode ? Try to run SELECT @@sql_mode; to check if it runs in

STRICT_TRANS_TABLES

theMcKing commented 7 years ago

ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZEROIN...

What do you mein with STRICT_TRANS_TABLES?

PierroK commented 7 years ago

You have two possibilities. 1) change the sql_mode (removing STRICT_TRANS_TABLES) -> information here https://www.liquidweb.com/kb/how-to-disable-mysql-strict-mode/ 2) you alter the table by changing the default value for the field 'admin_id' - it seems not really be used as there is no choice to chose who is the league_admin modify DEFAULT value: ALTER TABLE _liga MODIFY admin_id smallint(5) NOT NULL DEFAULT '0';

theMcKing commented 7 years ago

Thank you rogue!

You are my hero ;) The 1. step was the solution

Elessair commented 4 years ago

hi. i wanto to share that second option (modify SQL table) works for me