05-18-2021, 08:20 PM (This post was last modified: 05-18-2021, 08:22 PM by wdeda.)
If you were using CI 4 the query would be very simple, as below:
PHP Code:
public function getXpt() { $db = $this->db; $search = 'Taylor'; $query = $db->table('names') ->where('name', $search) ->orLike('name', $search.'%') // here the 'join' would enter ->orderBy('name', 'ASC') ->get();