insert data in mysql

조회 수: 5 (최근 30일)
Siti Maisarah
Siti Maisarah 2011년 4월 13일
hi..I want to insert data from the text box in gui to mysql database.. I was referring this tutorial, http://www.mathworks.com/help/toolbox/database/gs/bq9nzkl-1.html but at there, it already declare the data that want to insert. here the coding ->export_data = {'07-Aug-2003',50.44};
but if the data is insert by the user in gui, how? thanks

채택된 답변

Walter Roberson
Walter Roberson 2011년 4월 13일
Look at the GUI in step 8 of that tutorial, and see there the MATLAB Command. That command was generated based upon the other inputs, and is the command that would be executed in a MATLAB function in order to insert those values.
It appears the format is
insert(conn, TableNameString, FieldNamesCellStr, FieldValuesCell)
It doesn't matter to MATLAB whether you hard-code the FieldValuesCell or if you assign the cell to a variable and pass that, or if you build up the cell by get()'ing values from a user interface.
  댓글 수: 1
Siti Maisarah
Siti Maisarah 2011년 4월 15일
ok..i got it..one more thing, how to connect the query that we have made with the button in gui..for example, button insert..i really new in matlab.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by