|
| 1 | +# PHP-MATLAB-SQL-bridge |
| 2 | +A tool for allowing MATLAB scripts to communicate with an SQL database via PHP (using JSON) |
| 3 | + |
| 4 | +This is a tool for development purposes only! It should ideally only be used on the local machine which hosts the SQL database. If that's not possible, SSL *must* be implemented, since database credentials are sent in the query string as GET parameters to the PHP script. |
| 5 | + |
| 6 | + |
| 7 | +This tool is to allow MATLAB scripts to communicate with SQL databases via a PHP script. This is occasionally neccessary in development, if you do not have access to the MATLAB [Database Toolbox](https://www.mathworks.com/products/database.html). Obviously, the Database Toolbox should be used in preference to this tool if available. |
| 8 | + |
| 9 | +## To Install |
| 10 | + |
| 11 | +- Copy the PHP script to a locally accessible web directory, ensuring all neccessary requirements are implemented for PHP excecution (e.g. under an Apache server). |
| 12 | +- Edit `dbquery.m` with the correct url to the PHP script, and database credentials |
| 13 | +- Any SQL statements can be executed using the `dbquery` function in MATLAB, e.g. `data = dbquery('SELECT * FROM mytable')` |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +## Available under the MIT license. |
| 18 | + |
| 19 | +Copyright (c) 2017 Matt Judge |
| 20 | + |
| 21 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 22 | +of this software and associated documentation files (the "Software"), to deal |
| 23 | +in the Software without restriction, including without limitation the rights |
| 24 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 25 | +copies of the Software, and to permit persons to whom the Software is |
| 26 | +furnished to do so, subject to the following conditions: |
| 27 | + |
| 28 | +The above copyright notice and this permission notice shall be included in all |
| 29 | +copies or substantial portions of the Software. |
| 30 | + |
| 31 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 32 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 33 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 34 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 35 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 36 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 37 | +SOFTWARE. |
0 commit comments