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