Added a search function, using SQL statment