Fixing index.php to work with searches and order by statements since the flow must be changed to work with queryDB