test('GET', []) ->
SQL = "select id, greeting_text from greetings",
Result = get_Data(boss_db:execute(SQL)),
{ok, [{result, Result}]}.
get_Data({data, {mysql_result, FieldsData, ValuesData, 0, 0, []}}) ->
Fields = [Field || {_, Field, _, _} <- FieldsData],
[lists:zip(Fields, Value) || Value <- ValuesData].
--------------------------------
{% for item in result %}
<b>{{ item.id }} --- {{ item.greeting_text }}</b><br/>
{% endfor %}
here is some code work for mysql.
wish that help you
在 2012年4月16日星期一UTC+8下午3时09分23秒,9527写道:
>
> If use *boss_db:execute("select * from tablename")* to query the *tablename
> *,how to get the every field value from the query result?
>
> --
> 我踏月色而来!
>
--
You received this message because you are subscribed to the Google Groups
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit
https://groups.google.com/d/msgid/chicagoboss/89f6fd66-3520-4e3b-a4b1-07ea1713ace0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.