summaryrefslogtreecommitdiffstats
path: root/Website/insertdevice.php
blob: 787589172d9c5742f5279f4a06334274d94f1bd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
include 'dbconnection.php';

$db = mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($dbname,$db);

$link = $db;
if (!$link) {
    die('Could not connect: ' . mysql_error());
}

else {
	$sql="UPDATE DeviceAddressTable SET portName = '$_REQUEST[portname]', number = '$_REQUEST[number]' WHERE deviceName = '$_REQUEST[device]'";

	if($result = mysql_query($sql ,$db)) 
		{  
		$message = '<font size="3" face="Century Gothic" color="LightGray"> UPDATE Device Succeed</font>';
		}
	else
		{ 
			$message = 'ERROR: '.mysql_error(); 
		}
	header('Location: http://132.230.4.202/tricode/devconfigManual.php');
	}

mysql_close($con)

?>