how to store multidimensional array in a single column in mysql database?

when i wrote it in this way it work fine...
a=[1];
update(conn, 'candidate', colnames, a, 'where candidate_id = 1');
but when i wrote it in this way it give the error
b=[1 2];
update(conn, 'candidate', colnames, a, 'where candidate_id = 1');
??? Index exceeds matrix dimensions.
Error in ==> database.update at 136
dataString = [ dataString fieldNames{j} ' = ' tmpstr ];

4 件のコメント

Oleg Komarov
Oleg Komarov 2012 年 5 月 30 日
Do you want to insert or update (change) some values?
Walter Roberson
Walter Roberson 2012 年 5 月 30 日
It gave an error when you defined b, even though you update() passing in "a" and not "b" at all ??
Shiza
Shiza 2012 年 5 月 30 日
oh sorrry.... i copied the same statment 2 times
...but in matlab i go with "b" in the query...
Shiza
Shiza 2012 年 5 月 30 日
i want to update the value...but the problem is not with the update statment..
just the 'b' array dont work fine in the same query...

サインインしてコメントする。

回答 (0 件)

カテゴリ

質問済み:

2012 年 5 月 30 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by