0
我想在3列中显示mysql表数据。我试过这段代码。但它不能帮助我。我使用var_dump并接收这个输出。显示3列中的动态表数据
array(1) { [0]=> string(5) "Gucci" }
array(1) { [0]=> string(16) "Business Insider" }
array(1) { [0]=> string(10) "Health.com" }
array(1) { [0]=> string(5) "Prada" }
array(1) { [0]=> string(6) "Orbitz" }
array(1) { [0]=> string(4) "Time" }
array(1) { [0]=> string(9) "dotTravel" }
array(1) { [0]=> string(7) "Expedia" }
注意:未定义偏移量:8在C:\ XAMPP \ htdocs中\ Store_Brand \ catscheck.php上线75 NULL
我也使用回波和收到这个输出:
Notice: Array to string conversion in C:\xampp\htdocs\Store_Brand\catscheck.php on line 75
MYSQL
<?php
$result = mysqli_query($con,"SELECT sm_brand_name FROM store_manufacture");
$data = Array();
while ($row = mysqli_fetch_row($result))
$data[] = $row;
for ($i = 0; $i < count($data)/3; $i++){ // Line 75
echo '<table><tr>';
for ($j = 0; $j < 3; $j++){
echo '<td>' . var_dump ($data[ $i + $j * 3]) . '</td>';
}
echo '</tr><tr>';
}
echo '</tr></table>';
?>
如果您向我们展示哪一条是您向我们展示的16条线中的第75条,它非常有用。 – RiggsFolly
@RiggsFolly更新了我的代码 – tabia