function retrieved_data=retrieve_data_from_sql_database(selection_clause)
%description: uses the database toolbox and sql syntax to return the information from the database that satisfies the given query
%called by: simple_database_querier, analyze_across_expts
%calls: no custom functions
%notes: selection_clause must be a cell
%code confirmed date: oct 24, 2012

if ismac
    conn = database('patchlog_data_dwn', 'root', 'testpass', 'com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/patchlog_data_dwn');
elseif isunix
    conn = database('patchlog_data_dwn', 'root', 'mysql3', 'com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/patchlog_data_dwn');
end
setdbprefs('datareturnformat','cellarray')

curs=exec(conn,[selection_clause{1}]);
curs=fetch(curs);
retrieved_data=curs.data;
    
close(curs)
close(conn)
end