-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplayResults.php
executable file
·52 lines (42 loc) · 973 Bytes
/
displayResults.php
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
<html>
<head>
<title>lol</title>
</head>
<body>
<script src="zoom/assets/jquery-1.7.1.min.js"></script>
<?php
function js2php_proc() {
$str = json_decode($_POST['str'], true);
echo json_encode($str);
}
js2php_proc();
?>
<?php
$command1 = shell_exec('raster2pgsql -s 4326 -I -C -M data/base.png -F -t 500x980 public.schema > elev-sample1.sql | psql -U postgres -d demo -f elev-sample1.sql');
if(!$command1) {
echo "Upload error!";
}
$dbconn=pg_connect("dbname=demo user=user password=user");
if(!$dbconn) {
echo "Error connecting to the database!<br> " ;
printf("%s", pg_errormessage($dbconn));
exit();
}
else {
echo "connected", "\n";
}
$result = pg_query($dbconn, "SELECT * FROM demo");
if(!$result) {
echo "An error occured.\n";
exit();
}
else {
//echo $result;
}
while ($row = pg_fetch_row($result)) {
echo "value1: $row[0] value2: $row[1] value3: $row[2]";
echo "<br />\n";
}
?>
</body>
</html>