ppicasso772 Posted July 18, 2015 Share Posted July 18, 2015 ERROR Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN categories ON topics.category_id = categories.id INNER ' at line 2' in C:\xampp\htdocs\talkingspace\libraries\Database.php:60 Stack trace: #0 C:\xampp\htdocs\talkingspace\libraries\Database.php(60): PDOStatement->execute() #1 C:\xampp\htdocs\talkingspace\libraries\Database.php(64): Database->execute() #2 C:\xampp\htdocs\talkingspace\libraries\Topic.php(44): Database->resultset() #3 C:\xampp\htdocs\talkingspace\topics.php(15): Topic->getByCategory('2') #4 {main} thrown in C:\xampp\htdocs\talkingspace\libraries\Database.php on line 60 Database.php Topic.php Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/ Share on other sites More sharing options...
Ch0cu3r Posted July 18, 2015 Share Posted July 18, 2015 (edited) You are getting that error because of the comma at the end of line 34 in Topic.php $this->db->query("SELECT topics.*, categories.*, users.username, users.avatar, //<-- delete this comma Edited July 18, 2015 by Ch0cu3r Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516696 Share on other sites More sharing options...
ppicasso772 Posted July 18, 2015 Author Share Posted July 18, 2015 than it says Fatal error: Call to undefined method Topic::getByCategory() in C:\xampp\htdocs\talkingspace\topics.php on line 15 i m thinking i have to write sth after $this->db->query("SELECT topics.*, categories.*, users.username, users.avatar,......here.... but i dont know what will i write . Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516697 Share on other sites More sharing options...
ppicasso772 Posted July 18, 2015 Author Share Posted July 18, 2015 (edited) how can i send a video . it will explain better Edited July 18, 2015 by ppicasso772 Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516703 Share on other sites More sharing options...
ppicasso772 Posted July 18, 2015 Author Share Posted July 18, 2015 ... Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516704 Share on other sites More sharing options...
scootstah Posted July 18, 2015 Share Posted July 18, 2015 So on line 15 of "C:\xampp\htdocs\talkingspace\topics.php", you're trying to call a method that doesn't exist. Either you didn't include the class file, you have a typo, or something else. Since you didn't show us the code we can't really help. Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516709 Share on other sites More sharing options...
ppicasso772 Posted July 18, 2015 Author Share Posted July 18, 2015 ... topic.php topics.php topic.php Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516710 Share on other sites More sharing options...
scootstah Posted July 18, 2015 Share Posted July 18, 2015 There's no reference of Topic::getByCategory() in the file you posted. Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516711 Share on other sites More sharing options...
ppicasso772 Posted July 18, 2015 Author Share Posted July 18, 2015 on which file ? topic.php ?? Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516712 Share on other sites More sharing options...
ppicasso772 Posted July 18, 2015 Author Share Posted July 18, 2015 would you fix and send me on which file has problem ? Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516713 Share on other sites More sharing options...
ppicasso772 Posted July 18, 2015 Author Share Posted July 18, 2015 ??? Quote Link to comment https://forums.phpfreaks.com/topic/297350-how-can-i-fix-this-problem/#findComment-1516714 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.