2013-05-02 63 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