Php 计算并打印每个表的每个应用程序的通过率(%)
现在我可以在表中列出每个应用程序/内部团队的名称。现在,我想从每个应用程序的每个表中找出通过的百分比,并在html页面上打印。每一天。。。表中有所有应用程序/内部团队名称以及相应的结果。Php 计算并打印每个表的每个应用程序的通过率(%),php,jquery,html,Php,Jquery,Html,现在我可以在表中列出每个应用程序/内部团队的名称。现在,我想从每个应用程序的每个表中找出通过的百分比,并在html页面上打印。每一天。。。表中有所有应用程序/内部团队名称以及相应的结果。 任何想法..如果以下查询正确:$result1=mysqli\u query$conn,从aw34\U 0530\U tc1015中选择*从aw34\U 0530\U tc1015中选择countid,其中结果为“通过”,应用程序为“ace”;从aw34\U 0530\U tc1015中选择countid,其
任何想法..如果以下查询正确:$result1=mysqli\u query$conn,从aw34\U 0530\U tc1015中选择*从aw34\U 0530\U tc1015中选择countid,其中结果为“通过”,应用程序为“ace”;从aw34\U 0530\U tc1015中选择countid,其中应用程序为“ace”;从aw34\U 0530\U tc1015中选择countid,其中结果为“通过”;从aw34\U 0530\U tc1015中选择countid,其中应用程序为“ace”*100->对于第一个表,已成功执行上述查询。但我无法将其转换为php代码查询。转换为php不会在php我的管理页面中显示任何结果。
<html>
<?php
$Show= htmlspecialchars($_GET["Show"]);
$team= htmlspecialchars($_GET["team"]);
$tablename = htmlspecialchars($_GET["tablename"]);
$servername="localhost";
$username="root";
$password="";
?>
<?php
// Create connection with mySQL
$conn = mysqli_connect($servername, $username, $password);
// Check connection
if (!$conn) {
die("Connection failed:" . mysqli_connect_error());
}
//echo "Connected to mysql successfully";
//select a database to work with
mysqli_query( $conn , "USE plm_dashboard" );
Echo "<Body bgcolor="."white".">" ;
//echo $Show;
Echo "<br>";
Echo "<br>";
Echo "Applied Filters Are <br> ";
//echo "Team = $team "; echo "TableName= $tablename ";
$Local_team= "Reports";
if ($Show == "failed"){
$Result_status = "passed";
} else {
// in this case the value of the $Result_status is 'all'
$Result_status = "";
}
echo "Result = $Show <br>";
//$result =mysqli_query($conn ,"SELECT * FROM aw34_0605_tc1122 where Application="."'".$team."'");
$result = mysqli_query($conn ,"SELECT * FROM teamnames");
$result1 =mysqli_query($conn ,"SELECT * FROM aw34_0530_tc1015 (Select count(id) from aw34_0530_tc1015 where result ='passed' and application='ace')/(Select count(id) from aw34_0530_tc1015 where application='ace')*100");
//$result =mysqli_query($conn ,"SELECT * FROM ". $tablename );
//********** determine number of rows result set **********/
// $row_cnt = $result->num_rows;
//mysqli_query()
//echo "Showing $row_cnt Results ";
//echo "<table border="."1".">
echo "<table border="."1"."align="."right".">
<tr>
<th>ID</th>
<th>Internal Team Names</th>
<th width="."10px"." >Passed % for aw34_0530_tc1015</th>
</tr>";
while($row = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['ID'] . "</td>";
echo "<td>" . $row['TeamInternalNames'] . "</td>";
echo "<td>" . $row['TeamName'] . "</td>";
// if ($row['Result'] == "passed") {
// echo "<td style="."background-color:#33FF38".">P</td>";
// } else {
// echo "<td style="."background-color:#FF334C".">F</td>";
// }
echo "</tr>";
}
echo "</table>";
ECHO "BYE";
mysqli_close($conn);
Echo "<Body>";
?>
</html>