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 's-tiny-automatic-camera-gives-everyone-a'' at line 1Query is SELECT *,date_format(dateEntered, '%D') as dateDay,date_format(dateEntered, '%b') as dateMonth, date_format(dateEntered, '%Y') as dateYear from newsItems where shortURL='memoto's-tiny-automatic-camera-gives-everyone-a'