php循环上的协助需求

时间:2019-03-30 21:35:28

标签: php mysqli

诚然,我是php的新手。我手头有一个项目,该项目需要运行一个php循环,对于投资者来说,如下所示。 我能够使用for循环列出投资

投资1 日期金额费用利润 19/01/02 10000 300. 2700

投资2 日期金额费用利润 19/01/05 15000 350. 3150

我有一个表,可以捕获数据库中的所有这些信息。 请协助

<?php

$queryCount = (“SELECT DISTINCT(IC) FROM history”);
$resultCount = mysqli_query($Conn, $queryCount);

while($row = mysqli_fetch_assoc($resultCount)) {
  $total = $row[“IC”];
}

$queryHistory = (“SELECT * FROM history”);
$resultHistory = mysqli_query($Conn, $queryHistory);

for($x = 1, $x <= $total, $x ++) {
  //while each count is being loaded, I wish to echo  each history below
 }

?>

0 个答案:

没有答案