2013-05-02 35 views
0

我有使用MySQL數據庫的PHP項目 我的問題是如何將數據從PHP(數據檢索從MySQL數據庫)傳遞到MATLAB程序 有沒有這樣做的工具?傳遞數據從PHP到MATLAB

回答

0

不需要使用PHP。您可以使用Database Toolbox發出SQL語句將數據導入MATLAB工作區。

實施例:

logintimeout(5) 
conn = database('dbtoolboxdemo', 'username', 'password') 
curs = exec(conn, 'select productNumber, productDescription from productTable') 

>> curs = 
     Attributes: [] 
      Data: {10x1 cell} 
    DatabaseObject: [1x1 database] 
     RowLimit: 0 
     SQLQuery: 'select productdescription from producttable' 
     Message: [] 
      Type: 'Database Cursor Object' 
     ResultSet: [1x1 sun.jdbc.odbc.JdbcOdbcResultSet] 
      Cursor: [1x1 com.mathworks.toolbox.database.sqlExec] 
     Statement: [1x1 sun.jdbc.odbc.JdbcOdbcStatement] 
      Fetch: [1x1 com.mathworks.toolbox.database.fetchTheData] 

close(curs) 
close(conn) 
+0

但是,我需要顯示在PHP輸出? – user2046278 2013-05-03 03:00:54

+0

然後http://stackoverflow.com/q/13106317/395857 – 2013-05-03 03:38:27