I'm trying to develop a query that takes a user entry and uses it as the starting point for search results...but I need the database to return a whole list of names that come up after the top result for what they searched for. I also need the ability to be able to see all of names that may come before where the search result took them (in case they spelled the name wrong).
I have this (which I know doesn't work, I've tried several different queries, but this is all I can come up with):
$qry = "select id from names ";
$qry .= "where lastName like '%".$name['0']."%' and firstName like '%".$name['1']."%' and middleName like '%".$name['2']."' ";
$qry .= "order by lastName,firstName,middleName asc";
and then
$qry2 = "select lastName, firstName, middleName, nameSuffix, dateOfBirth, sex, race, height, weight from names ";
$qry2 .= "limit ".$idNum.", 15";
As i say, I know this is wrong, I just don't know what's right. 😕