gpt4 book ai didi

javascript - 如何从另一个表创建我的 php 表

转载 作者:行者123 更新时间:2023-11-29 17:16:01 24 4
gpt4 key购买 nike

我的网站上有一个表格,代码如下 this is the table image

此表的代码

<?php
$query = $db->query("SELECT * FROM bit_exchanges ORDER BY id DESC LIMIT 20");
if($query->num_rows>0) {
while($row = $query->fetch_assoc()) {
?>
<tr>
<td id="tabletext"><img src="<?php echo gatewayicon(gatewayinfo($row['gateway_send'],"name")); ?>" width="20px" height="20"> <?php echo gatewayinfo($row['gateway_send'],"name"); ?></td>
<td id="tabletext"><img src="<?php echo gatewayicon(gatewayinfo($row['gateway_receive'],"name")); ?>" width="20px" height="20"> <?php echo gatewayinfo($row['gateway_receive'],"name"); ?></td>
<td id="tabletext"><?php echo $row['amount_send']; ?> <?php echo gatewayinfo($row['gateway_send'],"currency"); ?></td>
<td id="tabletext"><?php echo cropexchangeid($row['exchange_id'],8); ?></td>
<td id="tabletext">
<?php
if($row['status'] == "1") {
echo '<span class="label label-warning"><i class="fa fa-clock-o"></i> '.$lang[status_1].'</span>';
} elseif($row['status'] == "2") {
echo '<span class="label label-warning"><i class="fa fa-clock-o"></i> '.$lang[status_2].'</span>';
} elseif($row['status'] == "3") {
echo '<span class="label label-info"><i class="fa fa-clock-o"></i> '.$lang[status_3].'</span>';
} elseif($row['status'] == "4") {
echo '<span class="label label-success"><i class="fa fa-check"></i> '.$lang[status_4].'</span>';
} elseif($row['status'] == "5") {
echo '<span class="label label-danger"><i class="fa fa-times"></i> '.$lang[status_5].'</span>';
} elseif($row['status'] == "6") {
echo '<span class="label label-danger"><i class="fa fa-times"></i> '.$lang[status_6].'</span>';
} elseif($row['status'] == "7") {
echo '<span class="label label-danger"><i class="fa fa-times"></i> '.$lang[status_7].'</span>';
} else {
echo '<span class="label label-default">'.$lang[status_unknown].'</span>';
}
?>
</td>
<td id="tabletext"><?php echo date("d/m/Y",$row['created']) ?></td>
</tr>
<?php
}
} else {
echo '<tr><td colspan="5">'.$lang[still_no_exchanges].'</td></tr>';
}
?>

我只想在当前表格底部创建一个新表格,其中包含仅“已处理”的所选行

我只想将这些行放入我的新表 see this image当“正在处理”状态被处理时,它会自动进入新表。请帮助我创建此查询。

这是我的数据库图像,my database image我只想要整个表行为“4”请帮忙。

最佳答案

这可能听起来有点简单,但为什么不将第一个数据库查询更改为:

"SELECT * FROM bit_exchanges WHERE status <> 4 ORDER BY id DESC LIMIT X"

您将不会获得状态为4的行。然后继续创建一个与您使用查询创建的表类似的新表

"SELECT * FROM bit_exchanges WHERE status=4 ORDER BY id DESC LIMIT X"

然后您可以删除 elseif 检查 ( elseif($row['status'] == "4" )。

您的第二个表-代码将如下所示:

<?php
$query = $db->query("SELECT * FROM bit_exchanges WHERE status=4 ORDER BY id DESC LIMIT X");
if($query->num_rows>0) {
while($row = $query->fetch_assoc()) {
?>
<tr>
<td id="tabletext"><img src="<?php echo gatewayicon(gatewayinfo($row['gateway_send'],"name")); ?>" width="20px" height="20"> <?php echo gatewayinfo($row['gateway_send'],"name"); ?></td>
<td id="tabletext"><img src="<?php echo gatewayicon(gatewayinfo($row['gateway_receive'],"name")); ?>" width="20px" height="20"> <?php echo gatewayinfo($row['gateway_receive'],"name"); ?></td>
<td id="tabletext"><?php echo $row['amount_send']; ?> <?php echo gatewayinfo($row['gateway_send'],"currency"); ?></td>
<td id="tabletext"><?php echo cropexchangeid($row['exchange_id'],8); ?></td>
<td id="tabletext">
<?php
echo '<span class="label label-success"><i class="fa fa-check"></i> '.$lang[status_4].'</span>';
?>
</td>
<td id="tabletext"><?php echo date("d/m/Y",$row['created']) ?></td>
</tr>

关于javascript - 如何从另一个表创建我的 php 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51624523/

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