0
大家好我對編程不是很有經驗,所以這可能很容易實現。多行之後的新行
我從一個MySQL表使用PHP拉數據我想顯示像這樣的輸出:
$行[1] $行[2]線斷裂
$行[3] $行[4]線路斷線
$行[5] $行[6]號線打破
等等
任何幫助,將不勝感激感謝
$user_table = select_table("users", "user_name ASC");
$rows = array();
while($row = mysqli_fetch_assoc($user_table)) {
$rows[] = $row;
}
$user_groups = array_chunk($rows, 2);
foreach ($user_groups as $user_group) {
echo "<tr>";
foreach($user_group as $row) {
echo "<td class=\"user-box\">{$row["user_name"]}</td>";
}
echo "</tr>";
}
這是我的工作代碼。感謝蒂姆
你有什麼到目前爲止的例子嗎?如果你使用mysql來拉數據,我相信你知道'echo'命令。 – thatidiotguy
你怎麼「拉數據」? – EdCapetti
'$ user_table = select_table(「users」,「user_name ASC」); while($ user = mysqli_fetch_array($ user_table)){ \t echo「