You have an error in your SQL syntax near 'AND '/davis-sd-timewarner.html' LIKE CONCAT(dynamic_pages.beginurl,'%') AND '/da' at line 1