0001 function enum_vals = mysql_question_enum_vals(question_id, subquestion, conn_id)
0002
0003
0004
0005
0006 if nargin < 3
0007 error('%s: Requires 3 input arguments', mfilename)
0008 end
0009
0010 if isempty(subquestion)
0011 subquestion = 1;
0012 end
0013
0014 mysql_str = sprintf(['SELECT df.enum_values FROM data_format AS df, ' ...
0015 'question_x_data_format AS qdf ' ...
0016 'WHERE df.data_format_id = qdf.answer_format_id AND qdf.question_id = %d ' ...
0017 'AND qdf.subquestion = %d;'], question_id, subquestion);
0018
0019 enum_vals = mysql(conn_id, mysql_str);
0020
0021 enum_vals = regexp(regexprep(enum_vals{1},'"',''),',','split');
0022
0023 return