forked from glen18martin/Trackit
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cndt.php
36 lines (27 loc) · 1.33 KB
/
cndt.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
<?php
if(isset($_GET['routeid']))
{
$servername="localhost";
$username="root";
$password="";
$dbname="trackit";
$conn = new mysqli($servername, $username, $password, $dbname);
if (!$conn){
die("Connection Failed: ".mysqli_connect_error());
}
$sql = "SELECT DISTINCT routeid FROM route";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
// output data of each row
$select= '<select id="routeid" onchange="calla()" class="no-fastclick" name="select" style="width: 250px; height: 20px;"><option value="select">select</option>';
while($row = mysqli_fetch_assoc($result)) {
// echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
$select.='<option value="'.$row['routeid'].'">'.$row['routeid'].'</option>';
}
$select.='</select>';
echo $select;
} else {
echo "0 results";
}
}
?>