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 'FROM topics INNER JOIN categories ON topics.category_id = categori' at line 1' 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(43): Database->resultset() #3 C:\xampp\htdocs\talkingspace\topics.php(15): Topic->getByCategory('1') #4 {main} thrown in C:\xampp\htdocs\talkingspace\libraries\Database.php on line 60
how can i fix this on php
Moderator: General Moderators
Re: how can i fix this on php
Would be helpful to see the query in question.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: how can i fix this on php
Yes, the SQL would be helpful. My wild guess is that it your are not using table.field format in your field list while doing a join, given that the error is near 'FROM topics INNER JOIN categories ON topics.category_id = categori'
(#10850)