ich habe zwei Tabellen eine Positionstabelle und Kundentabelle: Dynamische Zeilenspanne php while-Schleife
in der Tabelle können Sie die zweite Artikel Artikel-ID siehe 1002 haben zwei entries.and ich will colspan zu, dass hinzufügen Artikel für Spalte 1 und 3.
<table>
<tr>
<th>Item ID</th>
<th>Item Color</th>
<th>Customer</th>
</tr>
<?php
$sql = mysqi_query($con,"select * from item_table");
while($row = mysqli_fetch_array($sql)){
?>
<tr>
<td><?=$row['item_id'];?></td>
<td><?=$row['item_color'];?></td>
<td>
<select>
<?php
$sql_cust = mysqli_query($con,"select * from customer_tbl");
while($row_cust = mysqli_fetch_array()){
if($row['customer_id'] == $row_cust['customer_id']){
echo "<option selected='selected' >".$row['customer_name']."</option>";
}else{
echo "<option>".$row['customer_name']."</option>";
}
<?php
}
?>
</select>
</td>
</tr>
<?php
}
?>
</table>
Aber es in gewohnter Weise drucken, ich habe keine Ahnung, wie rowspan in loop..please hinzuzufügen schlagen einige Logik seine geschätzt zu lösen.