fixed the first SQL query in index.php. This file is currently in a monolithic style script.