VideoTube icon indicating copy to clipboard operation
VideoTube copied to clipboard

no comments table

Open mrlolklo opened this issue 2 years ago • 2 comments

Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'videotube.comments' doesn't exist in C:\xampp\htdocs\includes\classes\Video.php:231 Stack trace: #0 C:\xampp\htdocs\includes\classes\Video.php(231): PDOStatement->execute() #1 C:\xampp\htdocs\includes\classes\CommentSection.php(20): Video->getNumOfComments() #2 C:\xampp\htdocs\includes\classes\CommentSection.php(16): commentSection->createCommentSection() #3 C:\xampp\htdocs\watch.php(33): commentSection->create() #4 {main} thrown in C:\xampp\htdocs\includes\classes\Video.php on line 231

mrlolklo avatar Aug 18 '23 10:08 mrlolklo

The error is being thrown because the comments table does not exist in the videotube database. Here are some steps you can take to resolve this issue:

Check Database Schema: Make sure that the comments table actually exists in the videotube database. You can do this by logging into your database management tool (like phpMyAdmin) and checking the list of tables.

Check SQL Query: Look at the SQL query on line 231 of Video.php file and make sure it is correct. If the table name is misspelled or if there's any other error in the query, that could be causing the issue.

Create Table: If the comments table doesn't exist, you'll need to create it. You should find the SQL schema for your application and run the necessary SQL commands to create the comments table with the correct structure.

Once you've taken these steps, the error should be resolved. If you're still seeing the error, you may need to review your application's code and database schema to make sure everything is set up correctly.

menj avatar Oct 22 '23 03:10 menj

The error is being thrown because the comments table does not exist in the videotube database. Here are some steps you can take to resolve this issue:

Check Database Schema: Make sure that the comments table actually exists in the videotube database. You can do this by logging into your database management tool (like phpMyAdmin) and checking the list of tables.

Check SQL Query: Look at the SQL query on line 231 of Video.php file and make sure it is correct. If the table name is misspelled or if there's any other error in the query, that could be causing the issue.

Create Table: If the comments table doesn't exist, you'll need to create it. You should find the SQL schema for your application and run the necessary SQL commands to create the comments table with the correct structure.

Once you've taken these steps, the error should be resolved. If you're still seeing the error, you may need to review your application's code and database schema to make sure everything is set up correctly.

An AI answer

koubaki avatar Jul 03 '24 10:07 koubaki