Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 将值显示在申请人下方的标签上_Php_Html - Fatal编程技术网

Php 将值显示在申请人下方的标签上

Php 将值显示在申请人下方的标签上,php,html,Php,Html,我必须从数据库表callcount.php中取出值,我已经得到了49。问题是如何插入html <?php $servername = "localhost"; $username = "root"; $password = ""; $dbname = "hopeplace"; // Create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // Check connectio

我必须从数据库表call
count.php
中取出值,我已经得到了49。问题是如何插入html

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "hopeplace";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}

$sql = "SELECT COUNT(*) AS TOTAL_APPLICANT FROM applicant";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
    // output data of each row
    while ($row = mysqli_fetch_assoc($result)) {
        echo $row["TOTAL_APPLICANT"];
    }
} else {
    echo "0 results";
}

mysqli_close($conn);
?>

待决申请人的容器代码

<div class="content">
    <div class="row">
        <div class="col-xs-5">
            <div class="icon-big icon-danger text-center">
                <i class="ti-user"></i>
            </div>
        </div>
        <div class="col-xs-7">
            <div class="numbers">
                <p>Applicant Pending</p>
                <p>*this is the place where value need to be put*</p>
            </div>
        </div>
    </div>
    <div class="footer">
        <hr />

    </div>
</div>

待决申请人

*这是需要进行价值评估的地方*



将html和php保存在同一文件中,或确保html代码保存为
.php
文件。因此,您的脚本将是-

将html和php保存在同一个文件中,或确保您的html代码保存为
.php
文件。因此,您的脚本将是-
您可以为一个变量赋值,并在html中回显该变量

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "hopeplace";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
   die("Connection failed: " . mysqli_connect_error());
}
$count = 0;
$sql = "SELECT COUNT(*) AS TOTAL_APPLICANT FROM applicant";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
// output data of each row
   while($row = mysqli_fetch_assoc($result)) {
      $count = $row["TOTAL_APPLICANT"] ;
   }
} 
mysqli_close($conn);
?>

待决申请人容器的代码如下


待决申请人



您可以为一个变量赋值,并在html中回显该变量

<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "hopeplace";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
   die("Connection failed: " . mysqli_connect_error());
}
$count = 0;
$sql = "SELECT COUNT(*) AS TOTAL_APPLICANT FROM applicant";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
// output data of each row
   while($row = mysqli_fetch_assoc($result)) {
      $count = $row["TOTAL_APPLICANT"] ;
   }
} 
mysqli_close($conn);
?>

待决申请人容器的代码如下


待决申请人



您可以在php文件中编写html标记。合并代码和另存为.php文件。然后像这样使用

,您可以在php文件中编写html标记。合并代码和另存为.php文件。然后像这样使用