Hi,
I found this code which I placed in the htdocs folder of apache but my database is still not showing the arduino value. How can I run this code please as I'm new to web servers?
<html><body>
test server page<br>
<?
$temp1 = $HTTP_GET_VARS['temp1'];
if(strlen($temp1) < 1) $temp1 = "0";
$dbcnx = mysql_connect("localhost","user", "password");
if(!$dbcnx)
{
echo( "<P>Unable to connect to the database server at this time.</P></body></html>" );
exit();
}
if(!mysql_select_db("test") )
{
echo( "<P>Unable to locate the test database at this time.</P></body></html>" );
exit();
}
$result = mysql_query("INSERT INTO temperatures (temp1) VALUES ($temp1)");
if(!$result) echo("<P>Insert failed</P>");
else echo("<P>Insert ok</P>");
mysql_close($dbcnx);
echo('temp1 = ' . $temp1 . ' ');
?>
</body>
</html>