Page 1 of 1

how can i fix this on php

Posted: Sat Jul 18, 2015 8:15 am
by ppicasso

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

Re: how can i fix this on php

Posted: Sat Jul 18, 2015 8:21 am
by Celauran
Would be helpful to see the query in question.

Re: how can i fix this on php

Posted: Sun Jul 19, 2015 1:36 pm
by Christopher
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'