I always go with a deluxe hosting account with Godaddy. With this account, you can add as many domains to it as you want for around 10.00 each. It is a minimal effort to create a mysqyl database and add fields. So you need several ingredients to do what I suggest. First, I do not bother trying to write code on the Prop for http protocol, that gets to be a headache for me, especially for things like accessing a database. Instead, PHP is very easy to figure out, and create little pages that do all the real http work and just echo the responses. I will give you an example of a PHP page that you can pass the database address, username, and password. The mysql database can be on the same server or on any other server. Finding a free webserver may be possible to park the pages, but parking a database for free.. I am not sure if that exists, you can google free mysql database, free hosting etc. Who cares if they banners etc, no one is ever going to see the page but you probably. Most of the sites I have used are cheap, domains can be around 10 a year, hosting for a single site can be around 10 also. Finding a service with a quick install mysql db will make things easier. It doesn't get much easier than Godaddy IMO.
This is a page that will read a database and echo what you need back. This could be one or many values returned.
You would need to modify this to your needs. PHP is quite easy compared to Spin, so it would be no problem to modify the code here. Server is the address to find the db. DBU is the username and DBP is the password.
This is the code I used on the Prop to access the ReadDB page. It is not coded for the Spinerette, but rather for a wifi device via UART with the 4 port object( port 1 is for serial terminal debug, port 2 is the wifi device commands)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php $con = mysql_connect($_REQUEST[SERVER],$_REQUEST[DBU],$_REQUEST[DBP]);
// See if the connection to the DB was made
die('Could not connect: ' . mysql_error());
echo "CONNECTED TO DB";
$result = mysql_query("SELECT * FROM $_REQUEST[TABLE]");
while($row = mysql_fetch_array($result))
echo "CLOSED" . mysql_error();
ser.str(1, string("READ DB"))
beep(19, 2500, 100)
w(20_000_000) ' wait
beep(19, 2500, 100)
beep(19, 2500, 100)
ex 'exit if it was open from previous
ser.str(1, string("---")) 'debug
ser.str(2, string("$$$")) ' enter command mode on wifi
ser.str(2, string("open xxxxxxxxxx.com 80")) ' your webserver domain name where the page is loaded
ser.str(2, string("GET /readdb.php?")) ' open the web page shown above
ser.str(2, string("TABLE=table1")) 'DB table name ' provide the table name in the db
ser.str(2, string("&ID=1")) 'system ID in case of multiple systems using same db
ser.str(2, string("&SERVER=xxxxxx.db.xxxxxxxxxx.xxxxxxxxxresource.com")) '' DB server
ser.str(2, string("&DBU=xxxxxxxx")) ''DB username
ser.str(2, string("&DBP=xxxxxxxxx")) 'DB password
ser.str(2, string(" HTTP/1.1")) 'http GET terminator
ser.str(2, string("Host: xxxxxxxxx.com"))
ser.tx(2, LF) ' two LF required
RecWifiData 'after sending the command to open the page, now read whatever comes back
ParseDBReply 'disect and act on commands
The last ingredient is the page that is used to update the DB remotely by the user. This would mean changing a value on the database, this could be as simple as making a value become a 1 if you want to turn on an LED, or make the value 0 to turn it off. However, If the command is not desired to repeat over and over, you should add a field that I call a Confirmation Flag that the Spinerette can then toggle OFF after it successfully executes the command. For example.
1. A page with some buttons on it can be loaded by a user, pressing a button sends an update to the database and modifies a field with a command value. It also sets the CONFIRM flag to 1 so that the Spinerette will know there is data available for use. Sort of a flow control.
2. Spinerette reads DB and checks to see if the Confirm Flag has been to 1 = DATA READY( this could be as simple as the remote page setting the flag to a 1 if there was new data or commands added to the DB.
3. If the Flag is a 1, meaning new data or commands posted, the Spinerret will then parse the commands and do what it should do based on the command
4. After doing the command, the Spinerette accesses a page I call CONFIRM.php. This page will then reset the Confirm flag to a 0 so that A. The remote user can know if the command has been executed, and B. The Spinerette does not keep repeating the same command over and over again.
5. A Status page can be set up that reads the CONFIRM flag and shows the status of the command. Continuous refreshing will eventually show the flag set back to 0, meaning the command was executed.