designanddev Posted January 21, 2013 Share Posted January 21, 2013 Hi all can anyone spot what im doing wrong with this query? it keeps coming up with a mysql error. $result_set = self::find_by_sql("SELECT * FROM ".self::$table_name."ORDER BY 'photographs'.'id' DESC LIMIT 3 "); Kind Regards Link to comment https://forums.phpfreaks.com/topic/273463-mysql-syntax-error-help/ Share on other sites More sharing options...
Jessica Posted January 21, 2013 Share Posted January 21, 2013 You probably need a space before ORDER. In the future POST THE ERROR. Link to comment https://forums.phpfreaks.com/topic/273463-mysql-syntax-error-help/#findComment-1407379 Share on other sites More sharing options...
requinix Posted January 22, 2013 Share Posted January 22, 2013 And you're using the wrong quotes for the table and field names. They have to be backticks `, not quotes " or apostrophes '. Link to comment https://forums.phpfreaks.com/topic/273463-mysql-syntax-error-help/#findComment-1407413 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.