【发布时间】:2021-04-07 19:37:22
【问题描述】:
所以我希望它像这样打印出来
Coffee Name:
ColumbianPrice: 7.99
Total Sold: 3
Total earnings: 23.9
然后对每种类型的咖啡重复
是否有任何网页允许我这样做
$a_result = mysqli_query($connection_var, "SELECT COF_NAME, PRICE FROM coffees");
while ($rows = mysqli_fetch_array($a_result)){
print("<p>");
print($rows[0]);
print("<p>");
print($rows[1]);
print("<p>");
print($rows[2]);
print("<p>");
print($rows[3]);
print("<p>");
print($rows[4]);
print("</p>");
}
目前,这是我所拥有的,但知道它不正确。任何帮助非常感谢?
【问题讨论】:
-
好吧,你打开了 5 个
p元素,但只关闭了 1 个元素,这样会产生一些奇怪的格式。您也只选择 2 列,但尝试访问 5 个索引,这是另一个问题。请澄清it is not correct,值,显示,其他?