Answer the question
In order to leave comments, you need to log in
Sending data to SQL table?
Good afternoon, comrades, I have a problem, I can’t send data to the table, I need to make sure that the test results are first remembered for me after passing it (by remembering, I mean that after passing the test, they should be sent to the result table with login parameters user name, test name or id (I don't know which is better, test grade) Testing takes place on the Test.php page and all the functions used in it are described in the Functions.php file. Connection to the database occurs in the db.php file. All my attempts to memorize the result on line 175 in the Functions.php file.
Project link on GitHub: https://github.com/YTGoodFox/YTGoodFox.github.io
Database file link: https://drive.google.com/file/d/1mQPa0jOtsMQCAS85Y...
Now I will try to describe the variables that store data in themselves
$ulogin stores the login of the logged in user
$_SESSION does exactly the same but only stores it in an array
$test_id stores the test id from the test table
$rating stores the rating
I would also like something then this data was displayed on the result.php page, and for the user whose group in the users = admin table, the entire contents of the table were displayed, but this is already secondary, although it is necessary.
Please help, I beg you.
Answer the question
In order to leave comments, you need to log in
Try changing the structure of the result table to this, create the result table like this:
CREATE TABLE `result` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`test_name` int(11) NOT NULL,
`login` varchar(255) CHARACTER SET utf8 NOT NULL,
`rating` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question