フィルターのクリア

How can i display the data what i want to looking into the table?

1 回表示 (過去 30 日間)
Alvindra Pratama
Alvindra Pratama 2016 年 5 月 28 日
コメント済み: Geoff Hayes 2016 年 5 月 29 日
i Have a GUI like this :
I have about 100 data stored in MySQL databse and everything telahh I show into a table that was in the GUI. To search for a specific name of the many data, then I make an edit text and search button. Edit text input is useful to accommodate the form of the name you want to search and find useful buttons to execute her. My question is how I can display only the data I was looking just in the table? before I have made a code in the search button, but when I was looking for, which is still performed all of the existing data in the database and not the data that is specific to that I typed in the edit text. The following is the code:
%if true
cari=char(get(handles.txtcari,'string'));
conn=database('pca','root','','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/');
sqlquery = ['select * from tbl_pca where id =''' cari ''''];
curs = exec(conn,sqlquery);
fetch(curs);
exec(conn, 'rollback');
exec(conn, 'commit');
[ mydata,header,no ] = Lihat()
set(handles.myTabel,'data',mydata,'ColumnName',header,'RowName',no);
set(handles.myTabel,'Data',mydata);% code
%end
  1 件のコメント
Geoff Hayes
Geoff Hayes 2016 年 5 月 29 日
Alvindra - does your above code (with the where clause) actually return the subset of data? And is it this subset of data that you want to display in the GUI (and so replace the previous set)?

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by