-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread.php
61 lines (41 loc) · 1.1 KB
/
read.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
53
54
55
56
57
58
59
60
61
<?php
$servername = "**********";
$uname = "**********";
$password = "**********";
$dbname = "**********";
// Create connection
$conn = new mysqli($servername, $uname, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT form FROM openexplorer";
$result = $conn->query($sql);
$data = array();
//while($row = mysqli_fetch_array($result)){
// $column[] = $row[$key];
//}
while ($row = mysqli_fetch_array($result)) {
array_push($data, $row["form"]);
}
echo json_encode($data);
//while($row = mysqli_fetch_array($result))
//{
//echo $row['form'].",";
//}
//$result = $conn->query($sql);
//echo $result;
//if ($result->num_rows > 0) {
// output data of each row
// $row = $result->fetch_assoc();
// $arrayx = $row["addresses"];
// if ($arrayx == '') {$arrayx = "[]";}
//} else { $arrayx = "[]"; }
//echo "Error" . $sql . "<br>" . $conn->error;
//if ($conn->query($sql) === TRUE) {
//echo "Read successfully";
//} else {
//echo "Error3" . $sql . "<br>" . $conn->error;
//}
$conn->close();
?>