Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Unable to retrieve string from MySQL

1 回表示 (過去 30 日間)
Amir Abedin
Amir Abedin 2020 年 7 月 9 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I am connecting to mysql database and retrieveing a row. The returned data only contains database fields that cointain integer but not strings.
cmd = 'SELECT * FROM table.stim WHERE sid =%d';
A1=3;
cmd = sprintf(cmd,A1);
query = sprintf(cmd);
conn = database('','admin','');
data = select(conn, cmd);
close(conn)
clear conn query
The returned data:
120 10 ''
actual database row:
120 10 s6-2-red-mr-xs.png
so I can retrieve the fieds with integer values, but the mysql field with "s6-2-red-mr-xs.png" is retutned as ''
Any help appreciated. Thank you
  1 件のコメント
Amir Abedin
Amir Abedin 2020 年 7 月 9 日
I figured out the problem. Mysql field character set must be utf8 for string type.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by