table data

I’m trying to display order data from my online business, right now its displaying orders with the same order number and I would like it since the orders are stored in multiple lines in the DB if I could have it like below. Also I would like to know if at the end of the row’s if its possible to have a select menu that would be able to list if the order is new, processing or shipped. Thanks in advance.


order Item description color
119 Leash dog lead red
collar dog collar blue
120 food dog food
121 leash dog lead green

Below is the current working code, can any on lend a hand?


<?php // { initialise variables $amt=10000; $start=0; // } // { connect to database function dbRow($sql){ $q=mysql_query($sql); $r=mysql_fetch_array($q); return $r; } function dbAll($sql){ $q=mysql_query($sql); while($r=mysql_fetch_array($q))$rs[]=$r; return $rs; } mysql_connect('localhost','root','vai0316'); mysql_select_db('barksand_barks'); // } // { count existing records $r=dbRow('select count(OrderID) as c from orders'); $total_records=$r['c']; // } // { start displaying records echo '{"iTotalRecords":'.$total_records.', "iTotalDisplayRecords":'.$total_records.', "aaData":['; $rs=dbAll("select * from orders, orderdetails where orderdetails.DetailOrderID = orders.OrderID "); $f=0; foreach($rs as $r){ if($f++) echo ','; echo '["',$r['OrderID'],'", "',$r['OrderShipping'],'", "',$r['OrderTotal'],'", "',$r['OrderDate'],'", "',$r['detailsColor'],'"]'; } echo ']}'; // }
Sponsor our Newsletter | Privacy Policy | Terms of Service