Fatal error: Uncaught mysqli_sql_exception: 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 'and DATEDIFF(NOW(), m3.inserted_at) < 7 then 1 else 0 end) as same_sender ' at line 2 in /home/dh_wcekaq/eseek.app/messages/index.php:130 Stack trace: #0 /home/dh_wcekaq/eseek.app/messages/index.php(130): mysqli->query('\n select *,\n...') #1 {main} thrown in /home/dh_wcekaq/eseek.app/messages/index.php on line 130