Hello all, Long time reader, first time poster.
I'm fairly new to PHP coming from CFML and I'd like to do something that seems to me very basic for web apps but as yet have not found any way of doing it.
I need to de-normalize a stack of tables and pull both orders and the items into one query.
Resulting in something like the following. Obviously there is a lot more but this gives the general idea.
Order_ID Item_ID
208 23935
208 23950
208 23957
214 24148
214 24156
My output should have one row per order with an inner loop over the items in that order. Something like this.
<table>
<?php
//outer loop
echo '<tr>';
echo '<td>'.$Order_ID.'</td>';
echo '<td>';
//inner loop
echo $Item_ID.'<br />';
//end inner loop
echo '<br /></td>';
echo '</tr>';
//end outer loop
?>
</table>
I hope this isn't too terribly complicated. How would someone go about this?
Apache 2.0 php 5.2 mysql 5.1.44
I'm fairly new to PHP coming from CFML and I'd like to do something that seems to me very basic for web apps but as yet have not found any way of doing it.
I need to de-normalize a stack of tables and pull both orders and the items into one query.
Resulting in something like the following. Obviously there is a lot more but this gives the general idea.
Order_ID Item_ID
208 23935
208 23950
208 23957
214 24148
214 24156
My output should have one row per order with an inner loop over the items in that order. Something like this.
<table>
<?php
//outer loop
echo '<tr>';
echo '<td>'.$Order_ID.'</td>';
echo '<td>';
//inner loop
echo $Item_ID.'<br />';
//end inner loop
echo '<br /></td>';
echo '</tr>';
//end outer loop
?>
</table>
I hope this isn't too terribly complicated. How would someone go about this?
Apache 2.0 php 5.2 mysql 5.1.44