第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

根據(jù)另一個數(shù)字增加一個數(shù)字

根據(jù)另一個數(shù)字增加一個數(shù)字

PHP
嚕嚕噠 2022-10-22 16:19:14
我正在嘗試找到一種方法來增加我的數(shù)據(jù)庫中的一個數(shù)字,我根據(jù)另一個從設(shè)備自動更新的數(shù)字手動輸入該數(shù)字。在我的數(shù)據(jù)庫中,我有幾列,但重要的是 cancelled_meter mec_in demult.``cancelled_meter`` 是自動更新的列``mec_in`` 是手動輸入的列``demult`` 也是自動更新的列這些列都是數(shù)字(例如cancelled_meter= 428080.00、mec_in= 2174827.00,demult通常是 1、100 或 1000。這是我在 PHP 中嘗試做的事情:    <?php    $sql = "SELECT id, cancelled_meter, total_drop, mec_in, mec_out, demult, val_pct             FROM machtest ORDER BY id DESC LIMIT 1";    $result = $conn->query($sql);if ($result->num_rows > 0) {    echo "<table><tr><th>ID</th>                     <th>Coin IN Meter</th>                     <th>Coin OUT Meter</th>                     <th>Demultiplication</th>                     <th>Pt Value</th>                     <th>Total IN</th>                     <th>Total OUT</th>                  </tr>";    while($row = $result->fetch_assoc()) {          $offset_in = $row["cancelled_meter"] - $row["mec_in"] * -1;        $abbs_in = abs($offset_in);        $round_in = abs($row["cancelled_meter"] / $row["demult"] + $abbs_in);                        $offset_out = $row["total_drop"] - $row["mec_out"] * -1;        $abbs_out = abs($offset_out);        $round_out = abs($row["total_drop"] / $row["demult"] + $abbs_out);                echo "<tr>                <td>"                    .$row["id"]."</td>".                "<td>"                    .$row["cancelled_meter"]."</td>".                "<td>"                    .$row["total_drop"]."</td>".                "<td>"                    .$row["demult"]."</td>".                "<td>"                    .$row["val_pct"]."</td>".                "<td>"                    .$round_in."</td>".                "<td>"                    .round($row["total_drop"] / $row["demult"] + $abbs_out)."</td>              <tr>";    }這種工作,但我想顯示更改mec_in時自動更新哪些cancelled_meter只顯示其他內(nèi)容。還有一件事是,它mec_in可以更大或更小 cancelled_meter,這就是為什么我需要一個積極的結(jié)果。我正在嘗試像mec_in= cancelled_meter/ demult+ 一些介于cancelled_meter和之間的偏移量mec_in。我試圖弄清楚這一點(diǎn),但我是初學(xué)者,所以如果有人有一些建議,我將非常感激。PS。我試圖在 php 文件上計算這個,但如果有人知道如何,在 MySQL 中也很好。
查看完整描述

1 回答

?
jeck貓

TA貢獻(xiàn)1909條經(jīng)驗(yàn) 獲得超7個贊

我不知道我腦子里想的是什么,但添加后$total = abs($round_in - $row["offset_in"]);效果很好。我offset_in通過做得到了專欄$round_inmec_in然后$round_in - $row["offset_in"]);給出了預(yù)期的結(jié)果。謝謝您的意見。



查看完整回答
反對 回復(fù) 2022-10-22
  • 1 回答
  • 0 關(guān)注
  • 152 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號