<?php $order_id = $_GET['order_id']; $query = "..."; $res = mysql_query( $query ); while ( $arr = mysql_fetch_array( $res ) ) { echo "<table>"; echo "<tr>"; ... echo "</tr>"; echo "<tr>"; ... echo "</tr>"; echo "</table>"; echo "<br><br>"; } ?>