【发布时间】:2019-03-27 17:56:13
【问题描述】:
我是这方面的初学者。
如果我在下拉选择中插入 P001(patient_id) 数据,那么它会在下拉选择中使用 P002,但从来自 phpmyadmin 的数据库中检索 P001 数据。
<?php
include "header.php";
include "connection.php";
?>
<form method="POST">
<div class="right_col" role="main">
<div class="">
<div class="page-title">
<div class="title_left">
<h3>Realtime Patient Health Monitor</h3>
</div>
<div class="title_right">
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-default" type="button">Go!</button>
</span>
</div>
</div>
</div>
</div>
<!--FRONT ENDS-->
<div class="clearfix"></div>
<div class="row" style="min-height:500px">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_content">
<label>Select Patient ID</label>
<select class="form-control" name="patient_id">
<?php
$result = mysqli_query($link,"SELECT patient_id from heart_reating");
while($row = mysqli_fetch_array($result))
echo "<option value='" . $row['patient_id'] . "'>" . $row['patient_id'] . "</option>";
?>
</select>
<input id="submit" type="submit" name="submit" value="submit">
<?php
if(isset($result)){
$res = mysqli_query($link, "select * from heart_reating limit 1");
}
// $res = mysqli_query($link, "select * from heart_reating ORDER BY id ASC LIMIT 1");
// $res = mysqli_query($link, "SELECT DISTINCT patient_id, sdi, rate, temp, max, min, interv FROM heart_reating");
// echo "<table class='table table-bordered'>";
?>
<col width=40>
<col width=50>
<col width=>
<col width=>
<col width=40>
<col width=40>
<col width=40>
<!--table properties close-->
<?php
if(isset($_POST['submit'])){
while ($row = mysqli_fetch_array($res)) { ?>
<tr>
<div>
<td >
<iframe src="linegraph.html" height="620px" width="620px"></iframe>
</td>
<td><iframe src="new.html" height="620px" width="620px"></iframe></td>
</div>
<td><?php echo $row["max"] ?></td>
<td><?php echo $row["min"] ?></td>
<td><?php echo $row["interv"] ?></td>
</tr>
<?php }}
?>
<!--<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>-->
</table>
<?php
/* echo "<tr>";
echo "<th>";
echo "Patient ID";
echo "</th>";
echo "<th>";
echo "Sepses Detection Index(%)";
echo "</th>";
echo "<th>";
echo "Heart Rate";
echo "</th>";
echo "<th>";
echo "Temperature";
echo "</th>";
echo "<th>";
echo "Max";
echo "</th>";
echo "<th>";
echo "Interval";
echo "</th>";
echo "<th>";
echo "Min";
echo "</th>";
echo "</tr>";
//variable declaration closed
while ($row = mysqli_fetch_array($res)) {
echo "<tr>";
echo "<td>";
// $pid = $row["patient_id"];
echo $row["patient_id"];
echo "</td>";
echo "<td>";
echo $row["sdi"];
echo "</td>";
echo "<td>";?>
<style>
.chart-container {
width: 640px;
height: 300px;
}
</style>
<!-- <div class="chart-container"> -->
<!-- <canvas id="mycanvas" width="300px" height="300px"></canvas> -->
<canvas class="chart-container" id="mycanvas"></canvas>
</div>
<script type="text/javascript" src="js2/jquery.min.js">
</script>
<script type="text/javascript" src="js2/Chart.min.js">
</script>
<script type="text/javascript" src="js2/linegraph.js">
</script>
<?php
echo $row["rate"];
echo "<td>";
echo $row["temp"];
echo "</td>";
echo "<td>";
echo $row["max"];
echo "</td>";
echo "<td>";
echo $row["interv"];
echo "</td>";
echo "<td>";
echo $row["min"];
echo "</td>";
echo "</tr>";
}
echo "</table>"; */
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="js2/jquery.min.js"></script>
<script type="text/javascript" src="js2/Chart.min.js"></script>
<script type="text/javascript" src="js2/linegraph.js"></script>
<?php
include "footer.php";
?>
在下拉选择中,如果选择第二位患者 ID,它应该绘制第二位患者的图表,截至目前,它仅在第一列数据上显示图表。 如果我选择其他患者,我想在哪里调用该数据并绘制图表。
【问题讨论】:
标签: php html mysql phpmyadmin