Hi all,
I am a php rookie. I like to get a PHP function returning an array which gets a string(search query) and db results(an array) as arguments. This array should be sorted in ascending (alphabetical) order with search query positions.
I tried of querying the results but i struck up with sorting with search query positioning.
My db Array()
My snippet

function getSearchRecords  ($string){

        $query="select name,member_id from member_details where name like '%$string%' order by name";
        $queryResult =  self::DbExecuteQuery($query);
        while($getRecords = self::DbFetchAssoc($queryResult)){
	return $listRecords;

will return hussain,usher,zaheerus (in this order).
but i need this function to return
usher [position of search query is at first]
zaheerus[position of search query is at last]