File indexing completed on 2025-01-18 09:27:06
0001 <?php
0002 require_once('./configurations.php');
0003
0004 $servername = $FEconfig['dbhost'];
0005 $username = $FEconfig['dbuser'];
0006 $password = $FEconfig['dbpass'];
0007 $dbname = $FEconfig['dbname'];
0008
0009 $plotGroupId = $_GET['plotGroupId'];
0010
0011
0012 $conn = mysqli_connect($servername, $username, $password, $dbname);
0013
0014 if (!$conn) {
0015 die("Connection failed: " . mysqli_connect_error());
0016 }
0017
0018 $sql = "SELECT PlotType_Groupings.PlotType_ID, Plot_Types.Name
0019 FROM PlotType_Groupings
0020 INNER JOIN Plot_Types ON PlotType_Groupings.PlotType_ID = Plot_Types.ID
0021 WHERE PlotType_Groupings.PlotGroup_ID = " . $plotGroupId . "
0022 ORDER BY PlotType_Groupings.PlotType_ID;";
0023
0024 $result = $conn->query($sql);
0025 $data = array();
0026 if ($result->num_rows > 0) {
0027
0028 while($row = $result->fetch_assoc()) {
0029 $data[]=$row;
0030 }
0031 }
0032 $conn->close();
0033
0034 echo json_encode($data);
0035 return json_encode($data);
0036 ?>