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-new-pvm-x300-professional-monitor-offers-p'' 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='sony's-new-pvm-x300-professional-monitor-offers-p'