03-31-2016 01:01 PM
Hello,
I was wondering how to interface LabVIEW with an online database. The database will be or is a part of wordpress. I hope that makes sense.
If anything is unclear, please ask and I will explain more.
thanks,
Frank
03-31-2016 01:56 PM
What sort of database is it?
You can try the following. Have never tried it with an online database but it does work on networked dBs.
Create a text document on your desktop and rename it to something like connection.udl
Double click the file
Configure the settings and test the connection
Open up the UDL file in a text editor and it will contain the connection string that can be used in the Database Connectivity Toolkit.
04-01-2016 01:43 AM
04-01-2016 04:26 AM
Wordpress runs on MySQL (only?), for security, many webhosts prevent access to databases from any IP address other than 'localhost' (i.e. the server running the PHP scripts) as Mike is alluding to. If your host allows it and you're willing to accept remote access, then you can use the Database Connectivity Toolkit (or another DB toolkit...I think there's a MySQL one) to connect to the database and get values. The more secure option is to create a RESTful HTTP PHP script which sits on the server and returns the data you want through an API.
04-01-2016 11:38 AM
Thanks all. I will try the suggestions and report back.
04-05-2016 04:42 PM
Hello Mike,
Your link was informative.
I have a few questions. Where will the php file reside? Does the php file run when the LabVIEW code runs? Can I run the code without LabVIEW to test if it will work on the server side?
thanks,
Frank
04-06-2016 04:06 AM
The PHP file sits on the web-server (e.g. where your database lives). It 'runs' every time a HTTP client tries to access it - when you visit http://mysite.com/test.php, it executes the PHP script 'test.php' and returns some data. It is completely separate and has nothing to do with LabVIEW - so you can probably write your API in PHP and test it without using LabVIEW at all.
04-06-2016 04:15 PM
Hello Sam,
Thanks for the reply.
Yes, I figure it would sit on the server side. But does it matter what folder on the server side the php file is located?
Also, I assume that the "OpenHandle.vi" in LabVIEW would need the username and password as inputs, yes?
thanks in advance,
Frank
04-06-2016 04:20 PM
04-06-2016 04:38 PM
Hello Mike,
Where can I find the server configuration?
thanks
Frank