SQL Syntax Error when exporting

Ran into an error in SQL syntax when exporting. Fixed here on line 127 by wrapping $this->page->id in single quotes.