gpt4 book ai didi

php - 加载时间未显示在应有的位置

转载 作者:行者123 更新时间:2023-11-29 20:58:42 26 4
gpt4 key购买 nike

我不明白这个问题,我正在显示 mysql 数据,然后是页面加载计时器。现在我已经将计时器函数放在 SQL 显示之后,并且事情正在反向加载。企鹅队在最后生成时间。 enter image description here

    <?php

// Time Record Start
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;

require_once("models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}
require_once("models/header.php");

echo "
<body>
<div align='center'>";
echo "
</div>
<div id='wrapper'>
<div id='top'><div id='logo'></div></div>
<div id='content'>
<h1>site</h1>
<h2>Internal Contact Management</h2>
<div id='left-nav'>";

include("left-nav.php");

echo "
</div>
<div id='main'>
Hey, $loggedInUser->displayname.</br></br>
<div align='center'><a href='admin_contacts_add.php'>Add</a></div>";

include('conn.php');
$query1=mysql_query("select * from contacts ORDER BY `contacts`.`name` ASC");
echo "<table align='center' width='60%'>
<tr>
<td><b>Name</b></td>
<td><b>Phone</b></td>
<td><b>Ext</b></td>
<td><b>Mobile</b></td>
<td><b>Edit</b></td>
<td><b>Delete</b></td>";
while($query2=mysql_fetch_array($query1))
{
echo "<tr><td>".$query2['name']."</td>";
echo "<td>".$query2['phone']."</td>";
echo "<td>".$query2['ext']."</td>";
echo "<td>".$query2['mobile']."</td>";
echo "<td><a href='admin_contacts_edit.php?id=".$query2['id']."'>Edit</a></td>";
echo "<td><a href='admin_contacts_delete.php?id=".$query2['id']."'>Delete</a></td><tr>";
}";
</ol>
</table>
</div>";
// Time Calculate and generate
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
$page = 'admin_contacts_view.php';
echo '</br>';
echo '<div align="center">Penguins generated this in '.$total_time.' seconds.</div>';
// Insert Time Data
$sql = "INSERT INTO preformance (page, time) VALUES('$page', '$total_time')";
$insert = $mysqli->query($sql);
echo "
<div id='bottom'></div>
</div>
</body>
</html>";

?>

最佳答案

我只是没有努力修复它,主要问题是关闭 tr 和关闭表之间并添加另一个 echo "

while($query2=mysql_fetch_array($query1))
{
echo "<tr>
<td>".$query2['name']."</td>";
echo "<td>".$query2['phone']."</td>";
echo "<td>".$query2['ext']."</td>";
echo "<td>".$query2['mobile']."</td>";
echo "<td><a href='admin_contacts_edit.php?id=".$query2['id']."'>Edit</a></td>";
echo "<td><a href='admin_contacts_delete.php?id=".$query2['id']."'>Delete</a></td>
</tr>";
}
echo "
</table>

关于php - 加载时间未显示在应有的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37408842/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com