Hello all ! I’m new here so i will try to be clear in what I have to do.
I am currently studying in an engineering school and I have to use existing php and explain what each part of the line of codes corresponds to.
So I found a code on the internet, but I can not make it work on my computer, it is a game called ‘Drafts’ and which is coded in php.
I can not run the code on my computer at all and I think I have a problem with adding the database, knowing that I am using the xammp software
Here is the code in question:
This is the PHP Code :
This is my CSS :
table {`
border-collapse: collapse
}
table td {
width: 60px;
height: 60px.
}
And this is my table :
–
– Structure of the tablejeu_dames_plateau
CREATE TABLE IF NOT EXISTS
jeu_dames_plateau
(
ID
tinyint(3) unsigned NOT NULL,
x
tinyint(2) unsigned NOT NULL,
y
tinyint(2) unsigned NOT NULL,
fond
tinyint(1) unsigned NOT NULL,
pion
tinyint(2) unsigned NOT NULL,
PRIMARY KEY (ID
)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;–
– Content of the tablejeu_dames_plateau
INSERT INTO
jeu_dames_plateau
(ID
,x
,y
,fond
,pion
) VALUES
(1, 1, 1, 0, 20),
(2, 1, 2, 1, 0),
(3, 1, 3, 0, 20),
(4, 1, 4, 1, 0),
(5, 1, 5, 0, 20),
(6, 1, 6, 1, 0),
(7, 1, 7, 0, 20),
(8, 1, 8, 1, 0),
(9, 1, 9, 0, 20),
(10, 1, 10, 1, 0),
(11, 2, 1, 1, 0),
(12, 2, 2, 0, 20),
(13, 2, 3, 1, 0),
(14, 2, 4, 0, 20),
(15, 2, 5, 1, 0),
(16, 2, 6, 0, 20),
(17, 2, 7, 1, 0),
(18, 2, 8, 0, 20),
(19, 2, 9, 1, 0),
(I’m sorry for the pictures but I did not know how to show you the code in the best way possible)
So my question is now:
Does this code seem to you to be right and functional, and does my concern really come from the fact that I can not connect to the database?
I hope I have been clear and thank you for your time !