So I'm building a little Search Engine to work with a database I've created and I want this search engine to return multiple results when you search. For example if you put in Jo it would return both John and Joe. This is what I've built so far:
$query = mysqli_query($con,"SELECT * FROM users WHERE name LIKE '%" . $searchquery . "%' ");
$results = mysqli_fetch_array($query);
return $results;
The problem I'm having is I only get one result, Joe because of alphabetical order, but I want it to return both Joe John and whatever other results. I know I'm missing something or doing something wrong and I would appreciate any guidance! Cheers!
returnstatement I'm assuming you have that block of code inside a function.