A shot in the dark according to my comment. If you will always receive accurate eligibility criteria. wouldn't it be best to execute a standard select query?
SELECT * FROM table WHERE company='The Demo'
Or for practical:
$Search = $_GET['company']; SELECT * FROM table WHERE company='$Search'
Obviously, use best practices when dealing with user inputs and queries.
The results drawn will either be in the lines found as Demo, the demo will be returned, or nothing.
If you do not always have an exact match. You can use $ _GET again with the added value, i.e. $ _GET ['Exact'] and have two different functions:
function ExactMatch ($DB,$Company){ } function NotExact($DB,$Company){ }
and confirm:
if (isset($_GET['Exact'])){ if ($_GET['Exact'] === 1){ ExactMatch($DB,$_GET['Company']); }else{ NotExact($DB,$_GET['Company']) } }
Alternatively, read in DBA.stackexchange:
https://dba.stackexchange.com/questions/39693/how-to-speed-up-queries-on-a-large-220-million-rows-table-9-gig-data
source share