<?php
HIDDEN:)
if(isset($_GET['action'])){
$action = $_GET['action'];
}
if($action == "add"){
$name = $_GET['name'];
$deviceID = $_GET['deviceID'];
$text = $_GET['text'];
$home = $_GET['home'];
$opponent = $_GET['opponent'];
mysql_query("INSERT INTO netdb
( name, deviceid, text,home, opponent) VALUES( '$name', '$deviceID', '$text','$home',
'$opponent') ")
or die(mysql_error());
}
//if($action == "getall"){
//$result = mysql_query("SELECT name, text, deviceID FROM netdb" ) or die(mysql_error());
if($action == "getall"){
$result = mysql_query("SELECT ID, name, text, deviceID, home, opponent FROM netdb
ORDER BY TIMESTAMP DESC LIMIT 10 " ) or die(mysql_error());
//DATA OUT TO PROGRAM
while($row = mysql_fetch_array($result)){
echo $row['ID'];
echo $row['name'];
echo "\r\n".$row['text'];
echo "\r\n".$row['deviceID']."\r\n";
echo $row['home'];
echo $row['opponent'];
echo $name;
echo $deviceID;
echo $text;
echo $home;
echo $opponent;
}
}
//delete messages
if($action == "delete"){
$deleteID = $_GET['ID'];
mysql_query("DELETE FROM netdb WHERE ID = '$deleteID'" ) or die(mysql_error());
}
?>