-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
53 lines (37 loc) · 867 Bytes
/
insert.php
File metadata and controls
53 lines (37 loc) · 867 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
$host = $_GET['argument1'];
$user = $_GET['argument2'];
$pass = $_GET['argument3'];
$lat = $_GET['argument4'];
$long = $_GET['argument5'];
$devname= $_GET['argument6'];
$r = mysql_connect($host, $user, $pass);
if (!$r) {
echo "Could not connect to server\n";
trigger_error(mysql_error(), E_USER_ERROR);
} else {
echo "Connection established\n";
}
$r = mysql_select_db('testst1984');
if( !$r)
{
echo "could not select database";
}
else
{
echo "database selected";
}
$s = addslashes($devname);
$query = "INSERT INTO bluetoothmap VALUES(0, $lat, $long, '$s')";
$rs = mysql_query($query);
if (!$rs) {
echo "Could not execute query: $query\n";
trigger_error(mysql_error(), E_USER_ERROR);
} else {
//echo "Query: $query executed\n";
}
//$row = mysql_fetch_row($rs);
//echo "$row[0] $row[1]\n";
mysql_close();
?>
<?php