First, THANK YOU guys, i'm learning python and IoT and your site is
I'm trying to develop a DIY project on my own where a python script runs on a RPI and sends data to update a MySQL database on a server. The project on the RPI is fine a working, but my problem is on the server side and I want to use my pythonanywhere account page.
In the following tutorial they do this with php: https://diyhacking.com/best-raspberry-pi-iot-project/
...but I know you don't allow php in you site...ughhhh!
So the php code is in fact very simple:
<?php
// code to print out the temperature database in tabular form
$username="root"; $password="raspberry"; $database="templog"; $server="localhost"; mysql_connect($server,$username,$password); mysql_select_db($database); $query="SELECT * FROM `temp-at-interrupt` ORDER BY `Date` DESC, `Time` DESC;"; $result=mysql_query($query);
?> <html> <head>
<title>Sensor Data</title> </head> <body> <h1>Temperature readings</h1>
<table border="1" cellspacing="1" cellpadding="1"> <tr> <td> Date </td> <td> Time </td> <td> Temperature </td> </tr>
<?php
if($result!==FALSE){
while($row = mysql_fetch_array($result)) {
printf("<tr><td> %s </td><td> %s </td><td> %s </td></tr>",
$row["Date"], $row["Time"], $row["Temperature"]);
}
mysql_free_result($result);
mysql_close();
}
?>
</table> </body> </html>
I think this code print outs the temperature database in tabular form. Is there a way top do this in your site guys. What language/script should I use ?
The other thing is, how to update the MySQL database with data being sent from the RPI ? In the aforementioned tutorial they use Google site by the scheme known as GCM push notification for what they use php!...what can I do to stay in pythonanywhere ?
Thank you again and regards.