Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html php打印错误_Php_Html_Loops_Html Table - Fatal编程技术网

html php打印错误

html php打印错误,php,html,loops,html-table,Php,Html,Loops,Html Table,我有以下脚本,它是一个订单列表: <?php $manifest_query = tep_db_query("SELECT o.franchise_id, o.orders_id, o.customers_id, o.delivery_name, o.delivery_street_address [...]"); while ($manifest = tep_db_fetch_array($manifest_query)){ ?> <tr> <td he

我有以下脚本,它是一个订单列表:

<?php
$manifest_query = tep_db_query("SELECT o.franchise_id, o.orders_id, 
    o.customers_id, o.delivery_name, o.delivery_street_address [...]");
while ($manifest = tep_db_fetch_array($manifest_query)){
?>
<tr>
<td height="50" align="center"><?php echo $manifest['orders_id'] ;?></td>
<td cellpadding="2"><?php echo $manifest['delivery_name'] .'<br> '. 
    $manifest['delivery_street_address'] .'<br> '. 
    $manifest['delivery_city'].'<br> '. 
    $manifest['delivery_postcode'].'<br> '. 
    $manifest['delivery_state'].'<br> '. $manifest['customers_telephone'] ;?>
</td>

<?php
$products_query = tep_db_query("select products_model, products_name, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$manifest['orders_id'] . "'");
while ($products = tep_db_fetch_array($products_query)) {
?>

<td><?php echo$products['products_quantity'] . '&nbsp;x&nbsp;' . $products['products_name'] . 
    '<br> ' . '&nbsp;&nbsp;'.$products['products_model'] .'<br>';?></td>
<?php
}
?>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td colspan="2"></td>
</tr>

<?php
}
?>

试试这个:


循环中有
标记。将它们移出循环,这样就不会为每个产品生成新的单元

while循环内部打印有
标记。如果你把它们放在这之外,它们应该只制作一个
<tr>
<td height="50" align="center"><?php echo $manifest['orders_id'] ;?></td>
<td cellpadding="2"><?php echo $manifest['delivery_name'] .'<br> '. $manifest['delivery_street_address'] .'<br> '. $manifest['delivery_city'].'<br> '. $manifest['delivery_postcode'].'<br> '. $manifest['delivery_state'].'<br> '. $manifest['customers_telephone'] ;?></td>
<td>
<?php
$products_query = tep_db_query("select orders_products_id, orders_id, products_id, products_model, products_name, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$manifest['orders_id'] . "'");

while ($products = tep_db_fetch_array($products_query)) {
?>

<?php echo$products['products_quantity'] . '&nbsp;x&nbsp;' . $products['products_name'] . '<br> ' . '&nbsp;&nbsp;'.$products['products_model'] .'<br>';?>
<?php
}
?>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>

<td>&nbsp;</td>

<td colspan="2"></td>

</tr>

<?php
}
?>