SELECT `page_title` FROM `lpdotcom`.`pages` WHERE `id` = index AND `page_title` IS NOT NULL AND TRIM(`page_title`) != '' LIMIT 1;
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 'index AND `page_title` IS NOT NULL AND TRIM(`page_title`) != '' LIMIT 1' at line 1